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