-->
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.  [ 1 post ] 
Author Message
 Post subject: Getting Lock on Select query on multiple run
PostPosted: Fri Jun 06, 2014 10:55 am 
Newbie

Joined: Fri Jun 06, 2014 10:44 am
Posts: 1
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


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

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.