-->
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() problem
PostPosted: Thu Sep 09, 2004 11:31 am 
Newbie

Joined: Thu Aug 12, 2004 10:27 am
Posts: 17
Hibernate version: 2.1.6

Name and version of the database you are using:postgresql 7.2

Hi,
I noticed that when hibernate loads objects using pessimistic lock as in
Code:
session.load(User.class,userId,LockMode.UPGRADE)
, hibernate loads the object data before locking it. So, hibernate issues 2 SQL statements: the first selects the object data and the second one locks it using something like "select id from user where id = ? for update".
Is this correct? I think session.load() should lock the object before getting its data or else the object may contain stale data. What is your opinion?

Thanks for your help,
Jair


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.