-->
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: session.load without lock options returns empty object
PostPosted: Thu Mar 31, 2011 11:02 am 
Newbie

Joined: Wed Jan 05, 2011 3:22 pm
Posts: 13
I have recently upgraded to 3.5.6 and I came across a small delete query in my application which is not working anymore..where im trying to delete a record.

Line1
MyInstance reportInstance = (MyInstance ) HibernateUtility.currentSession().load(MyInstance .class, reportInstanceId);
Line2
HibernateUtility.currentSession().delete(reportInstance);

Line 1 can not find the actual record from the DB (tried MSSQL, Oracle) so can not delete but if I use LockMode.UPGRADE_NOWAIT HB, Line 1 returns me the correct record but then my delete still doesnt work.

I had to surround this 2 lines with begin and commit transactions then things works properly. I dont understand the behavior ...this code was running fine in old HB libraries before.

Can anyone help me understand this ?

thanks
g


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.