Hi, Application is executing select query for multiple run. It runs as a asynchronous process. While seeing the log I found org.hibernate.exception.LockAcquisitionException: could not execute query Caused by: com.ibm.db2.jcc.a.SqlException: The current transaction has been rolled back because of a deadlock or timeout. Reason code "2". How a lock can be encounter on Hibernate select query. If I use Thread.sleep(Any number) then it works fine without giving error. But that is not a good solution. Is hibernate lock for select query?Isolation level used for my application is READ UNCOMMITED, so it should not lock ever but with the exception I can see lock. Also Do I need to commit transaction for select query in hibernate? Although I dont think so this should be the reason for lock. In my application everywhere at INSERT/UPDATE transaction is commited, but not for select which is valid too. Any pointers to avoid this Error. Thanks, Amit
|