hibernate - Transaction setTimeOut ignored in JTA environment -
we have problem setting transaction timeout on specific operations, overriding general timeout in application hibernate 4.2.1 , jboss 7as, since find values set "settimeout" ignored.
we have jta non-cmt persistence unit this:
<persistence-unit name="ourname" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>java:/datasources/ourdatasourcename</jta-data-source> <properties> <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.jtatransactionfactory"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.jbosstransactionmanagerlookup"/> <property name="hibernate.show_sql" value="false" /> <property name="hibernate.format_sql" value="false" /> </properties> </persistence-unit>
then declare persistenceunit this:
@persistenceunit(unitname="ourname") private entitymanagerfactory emf;
and sessionfactory it. such sessionfactory, open session , transaction set time-out before beginning it:
session = sessionfactory.opensession (); tx = session.gettransaction (); tx.settimeout (200); tx.begin ();
in our standalone.xml config file set global timeout (the 10s. displayed value testing, of course):
coordinator-environment enable-statistics="true" default-timeout="10"/>
the result no matter values set via "settimeout", timeout of 10 seconds applies.
anyone out there ideas of doing wrong appreciated!
thx!
Comments
Post a Comment