-->
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: Pessimistic locking with Firebird
PostPosted: Sun Apr 10, 2005 7:56 am 
Newbie

Joined: Sun Apr 10, 2005 6:38 am
Posts: 1
I am a newbie "Hibernator" and I asked myself how to lock a specific record using Firebird 1.0/1.5. I need this to implement some kind of sequence/generator-like counter.
If I use standard (?) session.lock(obj, LockMode.UPGRADE) functionality Hibernate 2 and 3 seem to fire a "SELECT ... FOR UPDATE" command.
But AFAIK this is not the way to go for a pessismistic lock in Firebird. In Firebird 1.5 you should use "SELECT ... WITH LOCK" (see for example
http://www.ibphoenix.com/main.nfs?a=ibphoenix&s=1111224689:216113&page=ibp_lock_records)
Is there a way to let Hibernate send this kind of command?
In Firebird 1.0 there is no such command. As a "workaround" I could send
in the same transaction an "UPDATE ... WHERE ID = ID" command before the loading of the object. But how can I execute this kind of native SQL command?

Thanks in advance
--Heiko


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.