Good morning. Sorry little English spoken. After 5 days I look for in all the various posts and forums, I thought I'd ask all of you. I'm currently using J2EE, hibernate 3.6.10, websphere 6.1 and DB2 9. I have to retrieve the log tables from hibernate and db2 using criteria. Are normal SELECT query. Each time you run the query, it makes me a LOCK ESCALATION on the table. I tell you the test I have done to be able to run a query with the WITH UR:
Test n. 1 :
Session session = HibernateUtil.getSessionfactorydb2().getCurrentSession(); session.setDefaultReadOnly(true);
Test n. 2 :
Criteria crit = session.createCriteria(NameTable.class); crit.setReadOnly(true);
Test n. 3 :
<hibernate-configuration> <session-factory> ... <property name="hibernate.connection.url">jdbc:db2://xx.xx.xx.xxx:448/DBD</property> <property name="hibernate.connection.datasource">jdbc/dbd</property> <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> <property name="hibernate.connection.isolation">1</property> ... </session-factory> </hibernate-configuration>
Test n. 4 :
<hibernate-mapping package="it.xx.wl.jmcconsole.web.applicationdata.hostlog.hbm"> <class name="nameTable" table="xxx" mutable="false"> ... </class> </hibernate>
I've never managed to remove the property LOCK ESCALATION from the table.
To be able to remove the LOCK ESCALATION I had to step in configuring datasource in websphere, adding the property "webSphereDefaultIsolationLevel" equal to 1 and the property "readOnly" equal to true. How do I remove the LOCK ESCALATION without resorting to the websphere modest? If anyone knows how to help me.
Thanks
|