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: Can't get transactions working properly
PostPosted: Wed Aug 01, 2007 12:41 am 
Newbie

Joined: Sat Jul 14, 2007 6:02 pm
Posts: 8
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 ???


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.