Bug 907537 - session.createConsumer do not start session
session.createConsumer do not start session
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-jca (Show other bugs)
Unspecified Unspecified
high Severity high
: 2.3
: ---
Assigned To: Rajith Attapattu
MRG Quality Engineering
: Patch
Depends On:
  Show dependency treegraph
Reported: 2013-02-04 11:25 EST by ppecka
Modified: 2013-02-14 04:38 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-14 04:38:49 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
simple war with servlet (5.30 KB, application/x-compressed)
2013-02-04 11:25 EST, ppecka
no flags Details
EAP6 config (24.24 KB, text/xml)
2013-02-04 11:26 EST, ppecka
no flags Details

  None (edit)
Description ppecka 2013-02-04 11:25:43 EST
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):

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
@@ -858,7 +858,7 @@
-               if (_started){
+               if (!_started){
Comment 1 ppecka 2013-02-04 11:26:31 EST
Created attachment 692870 [details]
EAP6 config
Comment 2 Justin Ross 2013-02-11 09:36:44 EST
Rajith, please evaluate the patch.
Comment 3 Rajith Attapattu 2013-02-11 15:37:50 EST
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.)
Comment 4 Clebert Suconic 2013-02-11 19:18:43 EST
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?
Comment 5 ppecka 2013-02-14 04:38:49 EST
ok, clebert is right. but i wonder why this "if" statement is there.

Note You need to log in before you can comment on or make changes to this bug.