Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-10623

[camel-ejb] REQUIRES_NEW transaction does not work on latest EAP

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-6.3-R14-GA
    • jboss-fuse-6.3
    • Fuse EAP
    • None
    • % %
    • Hide

      1) Install fuse on EAP (6.4.15.GA should be working, jboss-eap-6.4.19 should fail)
      2) add user: username:admin, password: admin123., group: guest
      3) start container in standalone-full mode
      4) git clone https://gitlab.cee.redhat.com/jboss-fuse-qe/jbossqe-camel-it.git -b 6.3.x
      4) mvn clean install -am -amd -pl :ejb-test -Pjboss-eap -Dit.test=TransactionEjbTest#newTransactionRollbackTest

      Show
      1) Install fuse on EAP (6.4.15.GA should be working, jboss-eap-6.4.19 should fail) 2) add user: username: admin , password: admin123. , group: guest 3) start container in standalone-full mode 4) git clone https://gitlab.cee.redhat.com/jboss-fuse-qe/jbossqe-camel-it.git -b 6.3.x 4) mvn clean install -am -amd -pl :ejb-test -Pjboss-eap -Dit.test=TransactionEjbTest#newTransactionRollbackTest

    Description

      There is a problem with transactions on a few latest EAP container versions.

      <route>
      			<from uri="direct:newTransactionRollbackTest"/>
      
      			<transacted ref="PROPAGATION_REQUIRED"/>
      			<!-- send to JMS -->
      			<to uri="jms:queue:ejbTestRouteQueue?transacted=true&amp;password=${jboss.qa.password}&amp;username=${jboss.qa.username}"/>
      			<!-- call EJB to send to JMS -->
      			<to uri="ejb:java:module/NewTransactionEjb?method=accept"/>
      
      			<rollback markRollbackOnly="true"/>
      		</route>
      
      @Stateless
      @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) // default
      public class NewTransactionEjb {
      
          @Resource(mappedName = "java:/hornetq/ejbTestJmsXA")
      	private QueueConnectionFactory connectionFactory;
      
      	@Resource(mappedName = "java:/ejbTestEjbQueue")
      	private Destination queue;
      
      	public void accept(String message) throws Exception {
      		sendMessage("[" + getClass().getName() + "]:" + message);
      	}
      
      	private void sendMessage(String text) throws Exception {
      		final Connection connection = connectionFactory.createConnection();
      		connection.start();
      
      		try {
      			final Session session = connection.createSession(false, -1); // CMTD
      			final MessageProducer producer = session.createProducer(queue);
      			final TextMessage message = session.createTextMessage();
      			message.setText(text);
      			producer.send(message);
      		} finally {
      			connection.close();
      		}
      	}
      }
      

      Scenario
      1) jms component opens new transaction
      2) EJB opens new transaction and sends message to ejbTestEjbQueue
      3) rollback jms transaction
      4) assert message is present in ejbTestEjbQueue

      EJB transaction should be done because rollback should take place only for jms transaction

      This scenario was working (tested with Red Hat JBoss Enterprise Application Platform - Version 6.4.15.GA)

      After upgrade to jboss-eap-6.4.19 message is not present in ejbTestEjbQueue

      Attachments

        Issue Links

          Activity

            People

              tdiesler@redhat.com Thomas Diesler
              jbouska@redhat.com Jan Bouska
              Viliam Kasala Viliam Kasala
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: