0 Replies Latest reply on Apr 14, 2005 11:29 PM by jetrix chan

    JBoss4.0.0 + Hibernate2.1.5 Transaction problem

    jetrix chan Newbie

      Hi all:
      I used a hibernate service with JBoss4.0.0, the configure file:
      hibernate-service.xml

      <server>
       <mbean code="org.jboss.hibernate.jmx.Hibernate"
       name="jboss.har:service=OracleHibernate">
       <attribute name="DatasourceName">java:OracleDS</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
       <attribute name="SessionFactoryName">java:/hibernate/OracleSessionFactory</attribute>
       <attribute name="CacheProviderClass">net.sf.hibernate.cache.TreeCacheProvider</attribute>
       </mbean>
      </server>
      

      the Oracle-ds.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <!-- $Id: oracle-ds.xml,v 1.6 2004/09/15 14:37:40 loubyansky Exp $ -->
      <!-- ==================================================================== -->
      <!-- Datasource config for Oracle originally from Steven Coy -->
      <!-- ==================================================================== -->
      
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>OracleDS</jndi-name>
       <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:testdb</connection-url>
       <!--
      
       Here are a couple of the possible OCI configurations.
       For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
      
       <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
       or
       <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
      
       Clearly, its better to have TNS set up properly.
       -->
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>jetrix</user-name>
       <password>jetrix</password>
      
       <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
       <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
       <!-- Checks the Oracle error codes and messages for fatal errors -->
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>Oracle10g</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>
      


      at begin it work well , but in 5 to 6 minutes, the JBoss return a WARNING:
      11:10:07,688 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=matrix/14, BranchQual=, localId=14] timed out. status=STATUS_ACTIVE
      

      and jsp return :
      could not register synchronization with JTA TransactionManager
      


      why? Please help me.