|
Hi
having some problems getting transactions working properly.
Basically I am allow an update on an object - change to its name (part of the pk). the code looks like this
open session
session.update (obj)
session.lock(obj,upgrade)
begin transaction
session.createquery().unique != null (I do a search to make sure the name hasn't been used before ?)
make changes to obj
session.update(obj)
commit transaction
close session
I am using postgres in the backend. when I use pgadmin to view the server, I can see locks placed on the object being changed, but I do not see any transaction locks placed on the table. I can, whilst stepping through the application, change the values of the other records in the table.
I am not sure how to get around this ?
should I just catch the exception for key violation ???
|