-->
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: Question on lock time out setting
PostPosted: Tue Aug 11, 2015 1:42 am 
Newbie

Joined: Tue Aug 11, 2015 1:28 am
Posts: 1
Am using Hibernate core 4.2.11.Final and MySQL version 5.6 as the DB. I have a code that does pessimistic write lock on an Entity to avoid race conditions.

Now the issue am having is this - The same code is also expected to run against a MySQL DB in read-only mode for disaster recovery purposes. (Ours is a read intensive application). It is considered fine for writes to fail when application is run in read-only mode. However just this part of the code that does a pessimistic lock just hangs foreverr and does not return. I would expect this to fail with a timeout Exception.

I read that there is javax.persistence.lock.timeout setting that can help (throw an Exception after waiting). But in my case I am using Hibernate's SessionFactory classes (and configuration) and not JPA Entity Manager.

So is there any setting that will help me (code should throw back an exception after a wait).


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.