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?