-->
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: Problem using hibernate across JVMs
PostPosted: Mon Apr 18, 2011 4:18 pm 
Newbie

Joined: Fri Feb 11, 2011 5:35 pm
Posts: 5
Hi

My applicaton makes calls to a server which is clustered across 2 JVMs.
The requests can go to either servers.
I am using Spring with Hibernate for DB calls (for DB2 database).
However, I have noticed that there no automatic locking mechanism from Hibernate across JVMs. I did implement locking mechanism through something like - query.setLockMode("myBo", LockMode.UPGRADE); But this does not seem to work across the JVMs.

Problem scenario:

First JVM selects the data for update (with LockMode.UPGRADE in place) from Table1. Before first JVM finishes update, second JVM also selects the data from Table1(which should not happen). First JVM finishes update successfully. But second JVM fails (Update is happening on the index key for Table1) with DuplicateKeyException.

Can somebody please suggest a solution for this?

Thanks
Radhika


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.