-->
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 trying Pessimistic Locking
PostPosted: Wed Apr 27, 2005 8:55 am 
Newbie

Joined: Thu Aug 26, 2004 9:25 am
Posts: 8
Hi all, my problem is I need read and write exclusive lock on a specific record or table. It is a typicall problem of Critical Section. I've been trying all the methods than are specified on Hibernate resources and Hibernate In Action book but I can't get this lock.
If two transaction try to get the same record using the lock mode LockMode.UPGRADE, both of them get the record and I can't isolate the operation, so the second transaction doesn't catch modifications made by first.

Any clues ?

Thanks in advance.

P.S : the operation made using standard JDBC works (select ... for upgrade) so it isn't a DB problem.


Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

net.sf.hibernate.Transaction tx = session.beginTransaction();
Object obj = session.get(Object.class,id);
session.refresh(obj,LockMode.UPGRADE);
.... several modif over obj ....

session.saveOrUpdate(ide);
tx.commit();

Full stack trace of any exception that occurs:

Name and version of the database you are using:
DB2
The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


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.