0 Replies Latest reply on May 25, 2007 10:16 AM by davidbalazic

    Transaction timeout not detected ?

      Hi!

      We use jboss 4.0.4GA and the included hibernate.
      We have configured JTA transactions and a XA datasource (oracle).

      I noticed that it can happen that the transaction times out during a bean business method, but the call end without any error.
      I discovered this during debugging, when the program executes a bit slower ;)
      (due to stepping over the code)

      What happens is this :
      - method is entered and has a breakpoint
      - I step over some hibernate stuff, like saving and updating some persisted objects
      - right before the end , when all hibernate call are already stepped over, I wait a bit
      - in the log this appears :
      2007-05-25 14:38:00,015 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=my_pcs_name/58, BranchQual=, localId=58] timed out. status=STATUS_ACTIVE

      - then I let jboss to run the method to end

      What happens is that the client gets the methid finished without any error, as if everything were OK, but the data was not saved to the DB !


      I am not a guru, but this look like a missed error.

      Can some shed some light on the issue ?

      This is the hibernate cfg file :

      <hibernate-configuration>
       <session-factory>
       <!-- database connection settings -->
       <property name="connection.datasource">
       java:/jdbc/foo/DataSource
       </property>
       <property name="connection.autocommit">false</property>
       <property name="transaction.auto_close_session">true</property>
       <property name="transaction.flush_before_completion">
       true
       </property>
       <property name="dialect">
       org.hibernate.dialect.Oracle9Dialect
       </property>
       <property name="show_sql">false</property>
       <property name="show_type">true</property>
      
       <!-- J2EE config -->
       <property name="current_session_context_class">jta</property>
       <property name="transaction.factory_class">
       org.hibernate.transaction.JTATransactionFactory
       </property>
       <property name="transaction.manager_lookup_class">
       org.hibernate.transaction.JBossTransactionManagerLookup
       </property>
       <property name="session_factory_name">
       jdbc/foo/HibernateSessionFactory
       </property>
      
      
       <!-- disable second-level-cache -->
       <property name="cache.use_second_level_cache">false</property>
       <property name="cache.provider_class">
       org.hibernate.cache.NoCacheProvider
       </property>
      
       <!-- some mappings here ... cut out to save space in the forum post ... -->
       </session-factory>
      


      The datasource definition :

       <xa-datasource>
       <jndi-name>jdbc/foo/DataSource</jndi-name>
       <track-connection-by-tx />
       <isSameRM-override-value>false</isSameRM-override-value>
       <xa-datasource-class>
       oracle.jdbc.xa.client.OracleXADataSource
       </xa-datasource-class>
       <xa-datasource-property name="URL">
       jdbc:oracle:thin:@10.1..0:1521:FOO1
       </xa-datasource-property>
       <xa-datasource-property name="User">
       X_FOO
       </xa-datasource-property>
       <xa-datasource-property name="Password">
       bar
       </xa-datasource-property>
       <exception-sorter-class-name>
       org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
       </exception-sorter-class-name>
       <no-tx-separate-pools />
       <metadata>
       <type-mapping>Oracle9i</type-mapping>
       </metadata>
       <min-pool-size>1</min-pool-size>
       <max-pool-size>3</max-pool-size>
       <idle-timeout-minutes>0</idle-timeout-minutes>
       <check-valid-connection-sql>
       select 1 from dual
       </check-valid-connection-sql>
       </xa-datasource>