[jboss-jira] [JBoss JIRA] (WFLY-5074) MDB should not permit transaction attributes other than REQUIRED and NOT_SUPPORTED
Ondřej Chaloupka (JIRA)
issues at jboss.org
Mon Nov 9 07:10:00 EST 2015
[ https://issues.jboss.org/browse/WFLY-5074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126782#comment-13126782 ]
Ondřej Chaloupka edited comment on WFLY-5074 at 11/9/15 7:09 AM:
-----------------------------------------------------------------
Hi [~jmesnil],
my basic doubt was that being able to deploy MDB defined with {{REQUIRES_NEW}} is against spec and probably should not be permitted.
I haven't been reviewing the cause of the failure in my testcase deeper. Nevertheless it's possible to run a test in our testsuite in this way and I can see then this problem
# {{git clone git://git.app.eng.bos.redhat.com/jbossqe-eap-tests-transactions.git}}
# {{cd jbossqe-eap-tests-transactions}}
# {{export JBOSS_HOME=path/to/eap/wfly/distro}} (tested with EAP7.0.0.DR13/WFLY10.CR4 and the problem seems still exist)
# change annotation {{@TransactionAttribute(TransactionAttributeType.REQUIRED)}} to {{@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)}} in file {{jbossts/src/test/java/org/jboss/as/test/jbossts/crashrec/jms/mdb/JMSCrashMessageDrivenBean.java}}
# {{mvn clean verify -am -pl jbossts -DfailIfNoTests=false -Dtest=JMSProxyMdbMessagingServerCrashRecoveryTestCase#prepareHalt -Djbossts.noJTS -Dno.cleanup.at.teardown -Djboss.dist=$JBOSS_HOME}}
The failure is then shown as
{code}
JMSProxyMdbMessagingServerCrashRecoveryTestCase.prepareHalt:184->JMSMdbCrashRecoveryTestCase.checkAfterTestExecution:290 expectedCommit: got unexpected message in queue/MDBTriggerQueue (inqueue should be empty) [queue/crashRecoveryQueue:JMSCrashMessageDrivenBean] expected null, but was:<MDB:prepare_halt_proxy>
{code}
when it's expected to have the message being committed after the recovery manager starts to work but it seems that it's left in-doubt.
was (Author: ochaloup):
Hi [~jmesnil],
my basic doubt was that being able to deploy MDB defined with {{REQUIRES_NEW}} is against spec and probably should not be permitted.
I haven't been reviewing the cause of the failure in my testcase deeper. Nevertheless it's possible to run a test in our testsuite in this way and I can see then this problem
# {{git clone git://git.app.eng.bos.redhat.com/jbossqe-eap-tests-transactions.git}}
# {{cd jbossqe-eap-tests-transactions}}
# {{export JBOSS_HOME=path/to/eap/wfly/distro}} (tested with EAP7.0.0.DR13/WFLY10.CR4 and the problem seems still exist)
# change annotation {{@TransactionAttribute(TransactionAttributeType.REQUIRED)}} to {{@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)}} in file {{jbossts/src/test/java/org/jboss/as/test/jbossts/crashrec/jms/mdb/JMSCrashMessageDrivenBean.java}}
# {{mvn clean verify -am -pl jbossts -DfailIfNoTests=false -Dtest=JMSProxyMdbMessagingServerCrashRecoveryTestCase#prepareHalt -Djbossts.noJTS -Dno.cleanup.at.teardown -Djboss.dist=$JBOSS_HOME}}
> MDB should not permit transaction attributes other than REQUIRED and NOT_SUPPORTED
> -----------------------------------------------------------------------------------
>
> Key: WFLY-5074
> URL: https://issues.jboss.org/browse/WFLY-5074
> Project: WildFly
> Issue Type: Bug
> Components: EJB, JMS
> Reporter: Ondřej Chaloupka
> Assignee: Jeff Mesnil
> Attachments: JMSProxyMdbMessagingServerCrashRecoveryTestCase_prepareHalt_jta_server.log
>
>
> Message driven bean should be used only with transaction attributes REQUIRED an NOT_SUPPORTED.
> The ejb specification says
> {quote}
> 13.6.3 Container-Managed Transaction Demarcation for Message-Driven Beans
> Only the NOT_SUPPORTED and REQUIRED transaction attributes may be used for message-driven bean message listener methods. The use of the other transaction attributes is not meaningful for message-driven bean message listener methods because there is no pre-existing client transaction context (REQUIRES_NEW, SUPPORTS) and no client to handle exceptions (MANDATORY, NEVER).
> {quote}
> EAP 7 permits usage of other transaction attributes as well. In my testcase strangely attribute REQUIRED behaves differently than REQUIRES_NEW.
> I do have mdb receiving message from remote message broker of ActiveMQ and closing connection during the commit (during prepare phase of XA 2PC). It happens to me that if used REQUIRED then all works fine. If used REQUIRES_NEW message seems to be read from the inbound queue but returned there instead of being left in in-doubt state (as expected when txn failed to prepare all participants).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list