-->
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: How to set CURRENT LOCK TIMEOUT from Hibernate
PostPosted: Mon Apr 28, 2008 2:55 pm 
Newbie

Joined: Mon Apr 28, 2008 2:47 pm
Posts: 2
Hello,

I am using Hibernate to access a DB2 database. When running the application on active-active cluster, I am seeing an exception with SQLSTATE of 40001 indicating "Deadlock or timeout with automatic rollback occurred."

It is occuring while updating a commonly used table entry, since other transactions in progress may be locking the entry for update.

There is a SET CURRENT LOCK TIMEOUT on DB2 to increase the timeout value.

Could someone please tell me how to set this CURRENT LOCK TIMEOUT from Hibernate? Is there a property in properties file or a method on Session or Connection class, that I can use? Basically I need the timeout to be a high value such as 60 seconds etc?

I would really appreciate your help.

Thanks,
Priya


Top
 Profile  
 
 Post subject: Re: How to set CURRENT LOCK TIMEOUT from Hibernate
PostPosted: Mon Apr 28, 2008 3:15 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
I am not aware of any property setting for this. However, I have seen people sit on the way of connection checkouts and add the command to set these kind of settings. Some data sources also let you specify a sql that will be executed everything a new connection is made to database. Some jdbc provider also have properties for these settings so that you don't have to do it manually.




Farzad-


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.