Topic
2 replies Latest Post - ‏2012-06-14T07:34:35Z by Marco_Zuin
Marco_Zuin
Marco_Zuin
2 Posts
ACCEPTED ANSWER

Pinned topic Problem DB2 - hibernate - Whith Ur - WebSphere

‏2012-06-12T10:26:56Z |
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

Marco Z.
Updated on 2012-06-14T07:34:35Z at 2012-06-14T07:34:35Z by Marco_Zuin
  • krmilligan
    krmilligan
    438 Posts
    ACCEPTED ANSWER

    Re: Problem DB2 - hibernate - Whith Ur - WebSphere

    ‏2012-06-12T15:23:46Z  in response to Marco_Zuin
    Since you're referring to DB9, you'll need to post your question into this forum:
    https://www.ibm.com/developerworks/forums/forum.jspa?forumID=842