0 Replies Latest reply on May 6, 2007 8:35 AM by chipschoch

    Need nested, not distributed transactions

    chipschoch

      JBossAS 4.2.0 CR2

      I am deploying hibernate as a .sar for use by several webapps and MBean services. I need to be able to nest db transactions. Does anyone know how I should configure the jboss-service.xml so that I get a ThreadLocalSessionContext instead of a JTASessionContext? My current jboss-xml:

      <server>
      
      <mbean code="org.hibernate.jmx.HibernateService"
       name="jboss.jca:service=DocHubHibernateSessionFactory,name=DocHubHibernateSessionFactory">
      
       <!-- Required services -->
       <depends>jboss.jca:service=RARDeployer</depends>
       <depends>jboss.jca:service=LocalTxCM,name=DocHubDS</depends>
      
       <!-- Bind the Hibernate service to JNDI -->
       <attribute name="JndiName">java:/eLynx/DocHubHibernateSessionFactory</attribute>
      
       <!-- Datasource settings -->
       <attribute name="Datasource">java:DocHubDS</attribute>
       <attribute name="Dialect">org.hibernate.dialect.SQLServerDialect</attribute>
      
       <!-- Transaction integration -->
       <attribute name="TransactionStrategy">org.hibernate.transaction.JDBCTransactionFactory</attribute>
       <attribute name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
       <attribute name="FlushBeforeCompletionEnabled">true</attribute>
       <attribute name="AutoCloseSessionEnabled">true</attribute>
      
       <!-- Fetching options -->
       <attribute name="MaximumFetchDepth">5</attribute>
      
       <!-- Second-level caching -->
       <attribute name="SecondLevelCacheEnabled">true</attribute>
       <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
       <attribute name="QueryCacheEnabled">true</attribute>
      
       <!-- Logging -->
       <attribute name="ShowSqlEnabled">true</attribute>
      
       <!-- Mapping files -->
       <attribute name="MapResources">
      
       ...
      
       </attribute>
      
      
      </mbean>
      
      </server>


      Thanks.