These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Row level locking in Hibernate
PostPosted: Fri Oct 28, 2005 2:01 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Hi,
I am using Hibernate-2.1.3

Code:
2005-10-28 11:18:05,860 DEBUG [net.sf.hibernate.SQL] LOCKING TABLE CR_EXECUTION_LIST FOR ACCESS select crexecutio0_.PROCESSING_ENGINE_ID as PROCESSI1___, crexecutio0_.PROCESSING_ENGINE_VERSION_ID as PROCESSI2___, crexecutio0_.EXECUTION_LIST_ID as EXECUTIO3___, crexecutio0_.PROCESSING_ENGINE_ID as PROCESSI1_0_, crexecutio0_.PROCESSING_ENGINE_VERSION_ID as PROCESSI2_0_, crexecutio0_.EXECUTION_LIST_ID as EXECUTIO3_0_, crexecutio0_.UPDATE_DTTM as UPDATE_D4_0_, crexecutio0_.Component_Id as Componen5_0_, crexecutio0_.Component_Version_Id as Componen6_0_, crexecutio0_.Component_Type_Cd as Componen7_0_, crexecutio0_.Application_Sub_Type_Cd as Applicat8_0_, crexecutio0_.Priority_Ord as Priority9_0_, crexecutio0_.Logon_User as Logon_User0_, crexecutio0_.Logon_Password as Logon_P11_0_, crexecutio0_.Tap_Job_Id as Tap_Job_Id0_, crexecutio0_.Execution_Parameters_Txt as Executi13_0_, crexecutio0_.Lock_Cd as Lock_Cd0_, crexecutio0_.Submitted_Ind as Submitt15_0_, crexecutio0_.UPDATE_USER as UPDATE_16_0_, crexecutio0_.PROCESSING_ENGINE_ID as PROCESSI1_0_, crexecutio0_.PROCESSING_ENGINE_VERSION_ID as PROCESSI2_0_ from CR_EXECUTION_LIST crexecutio0_ where crexecutio0_.PROCESSING_ENGINE_ID=? and crexecutio0_.PROCESSING_ENGINE_VERSION_ID=?


The above log shows that while retrieving objects from a table, Hibernate acquires TABLE level lock. This is leading to a major performance issue in our application. Is there any way where i can specify Hibernate to use Row level locking? Sometimes because of the TABLE level locking, i even face the following exceptions, while using cache:

Code:
Caused by: net.sf.hibernate.cache.CacheException: org.jboss.cache.lock.TimeoutException: write lock for //com/abc/hibernateobject/myObj/com.abc.hibernateobject.myObjId@72412[id: =6700,versionId: =1] could not be acquired after 25000 ms. Lock map ownership Read lock owners: [<null>:70]
Write lock owner: null
(caller=Thread[TP-Processor1,5,jboss])
        at net.sf.hibernate.cache.TreeCache.put(TreeCache.java:70)
        at net.sf.hibernate.cache.TransactionalCache.update(TransactionalCache.java:63)
        at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:62)
        at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2407)
        at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2361)
        at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2229)
        at com.teradata.tap.system.persistence.ObjectHandler.hibernateAction(ObjectHandler.java:464)
        at com.teradata.tap.system.persistence.ObjectHandler.handleObject(ObjectHandler.java:370)
        ... 117 more


Is there a way to avoid this, using ROW level locking?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 28, 2005 2:17 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Please note that i am using JBoss-3.2.3. Also, i found an exactly similar issue reported by "mpruden" at:

http://forum.hibernate.org/viewtopic.php?t=935444&highlight=cache+jboss

Does anyone has a solution for the same?

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.