1 Reply Latest reply on Sep 13, 2010 12:07 AM by thunder.farmer

    Transaction-time doesn't take into effect -- JBoss510 GA

    thunder.farmer

      Hi,

       

      According to my test, the transaction-timeout setting on the method does't work.

      It doesn't throw the exception even if the transaction time exceeds the set time.

      Similar issue reported https://jira.jboss.org/browse/EJBTHREE-2127

       

       

      <?xml version="1.0"?>
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
                   xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
                                  http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"  version="5.0">
      <enterprise-beans>
      <session>
      <ejb-name>JBossMTBeanName</ejb-name>
      <local-home-jndi-name>thunder.jbossmt.ejb.JBossMTBeanEJB2LocalHome</local-home-jndi-name>
      <method-attributes>
      <method>
      <method-name>testTransactionTimeoutAttr</method-name>
      <transaction-timeout>10</transaction-timeout>
      </method>
      </method-attributes>
      <pool-config>
      <pool-max-size>20</pool-max-size>
      </pool-config>
      </session>
      </enterprise-beans>
      </jboss>

      <?xml version="1.0"?>

      <jboss xmlns="http://www.jboss.com/xml/ns/javaee

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

                   xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee

                                  http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"  version="5.0">

      <enterprise-beans>

      <session>

      <ejb-name>JBossMTBeanName</ejb-name>

      <local-home-jndi-name>thunder.jbossmt.ejb.JBossMTBeanEJB2LocalHome</local-home-jndi-name>

      <method-attributes>

      <method>

      <method-name>testTransactionTimeoutAttr</method-name>

      <transaction-timeout>10</transaction-timeout>

      </method>

      </method-attributes>

      <pool-config>

      <pool-max-size>20</pool-max-size>

      </pool-config>

      </session>

      </enterprise-beans>

      </jboss>

       

       

       

      @Override

      @TransactionAttribute(TransactionAttributeType.REQUIRED)

      public void testTransactionTimeoutAttr() {

      Query q = jbossWLMSTestTX.createNativeQuery("SELECT sleep(15)");

      q.getResultList();

      }

       

      Thanks&Regards

      Thunder