Created attachment 692869 [details] simple war with servlet Description of problem: session.createConsumer(queue) is not switching session's _started attribute, this causes receiver.receive() method to return null object everytime. Version-Release number of selected component (if applicable): EAP6 Steps to Reproduce: 1. start and configure EAP6 2. build webapp-war (attached) 3. access servlet http://localhost:8080/webapp-war/MyServlet Actual results: Servlet does not read messages from queue mrg_mrg_jca_mdb_transactions_in Expected results: Servlet reads all messages from mrg_mrg_jca_mdb_transactions_in Additional info: here is where i believe it should be corrected --- ./qpid-0.18/java/jca/src/main/java/org/apache/qpid/ra/QpidRASessionFactoryImpl.java +0100 @@ -858,7 +858,7 @@ session.setQpidSessionFactory(this); - if (_started){ + if (!_started){ session.start(); }
Created attachment 692870 [details] EAP6 config
Rajith, please evaluate the patch.
This patch is does not seem to be correct from a behavior pov. Looking at the code, the start() method in QpidRASessionFactoryImpl is responsible for starting the sessions it has created. Subsequently any newly created sessions will be started, provided the start method had been called before. This patch is causing sessions to be started as soon as they are created. This may not be desirable for certain applications. I'm not too familiar with JCA, but I wonder why the start() method is not called explicitly ? (In JMS the application is responsible for starting the connections, in JCA I'm not sure if it's the application or the App Server who's responsible for that.)
The test seems broken to me... I think the test was supposed to call start on the sessionReceiver... otherwise consumer.receive() wouldn't return anything. I think this is a rejection. Or am I missing anything here?
ok, clebert is right. but i wonder why this "if" statement is there.