This content has been marked as final.
Show 4 replies
-
1. Re: hibernate session handling
julien1 Aug 30, 2007 5:37 AM (in response to bvogt)We use a configuration of hibernate that automatically close the session when the JTA transaction commits or rollbacks.
-
2. Re: hibernate session handling
bvogt Aug 30, 2007 6:33 AM (in response to bvogt)and where is the commit/rollback initiated (explicitly/implicitly)?
for the example below, in: core\src\resources\portal-core-sar\conf\hibernate\user\hibernate.cfg.xml
I cannot find something related to that. Is it done somewhere else?
Thanks for the time you spend on this! -
3. Re: hibernate session handling
julien1 Aug 30, 2007 6:55 AM (in response to bvogt)This is done programmatically in org.jboss.portal.jems.hibernate.SessionFactoryBinder
// Force transaction manager lookup class and JTA env setPropertyIfAbsent("transaction.auto_close_session", "true"); setPropertyIfAbsent("transaction.flush_before_completion", "true"); setPropertyIfAbsent("hibernate.transaction.flush_before_completion", "true"); setPropertyIfAbsent("hibernate.transaction.factory_class", "org.hibernate.transaction.JTATransactionFactory"); setPropertyIfAbsent("hibernate.transaction.manager_lookup_class", "org.hibernate.transaction.JBossTransactionManagerLookup");
Transaction demarcation occurs in the server interceptor org.jboss.portal.core.aspects.server.TransactionInterceptor.java, the transaction demarcation is delegated to a JBoss AOP aspect which applies on the TransactionInterceptor, found in portal-aop.xml<metadata tag="transaction" class="org.jboss.portal.core.aspects.server.TransactionInterceptor"> <method name="invoke"> <trans-attribute>RequiresNew</trans-attribute> </method> </metadata>
-
4. Re: hibernate session handling
bvogt Aug 30, 2007 8:45 AM (in response to bvogt)Thanks for that! We're fighting against a serious MySQL exception bug, which requires an AS restart each day/night.