We use hibernate.3.1.3 with DB2.
We want to use the TRANSACTION_READ_UNCOMMITTED isolation level. We set the transaction isolation level as <property name=" hibernate.connection.isolation">1</property> in Hibernate.cfg.xml as below.
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory>
<property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property> <property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property> <property name="dialect">org.hibernate.dialect.DB2Dialect</property> <property name=" hibernate.connection.isolation">1</property> <property name="hibernate.max_fetch_depth">1</property> <property name="show_sql">false</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> <mapping resource="ormmapping/com/test/testing.hbm.xml"/> </session-factory> </hibernate-configuration>
In java code when we print the transaction isolation level we get the default isolation level that is 4. sessionFactory = config.buildSessionFactory(); Session hbmsession = sessionFactory.getCurrentSession(); System.out.println("isolation level :"+hbmSession.connection().getTransactionIsolation());
It is not picking the hibernate.connection.isolation property value mentioned in Hibernate.cfg.xml .
Please advise if anything else need to be done.
Quick response is appriciated.
Thanks in advance.
|