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: "Bug" in documentation for method lock() in class Session?
PostPosted: Wed Aug 05, 2009 3:27 am 
Beginner
Beginner

Joined: Wed Dec 10, 2008 5:59 am
Posts: 47
The documentation for lock(Object object, LockMode lockMode) explains:

Quote:
Obtain the specified lock level upon the given object. This may be used to perform a version check (LockMode.READ), to upgrade to a pessimistic lock (LockMode.UPGRADE), or to simply reassociate a transient instance with a session (LockMode.NONE). This operation cascades to associated instances if the association is mapped with cascade="lock".


However, should not transient be replaced with detached? I use lock() for reassociating detached (previously persistent, not associated with any Session) objects with a given Session.

If one wish to associate a transient instance with a Session, shouldn't that transient instance first be made persistent using save(), persist() or saveOrUpdate()?


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.