-->
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: Object state after lock() call
PostPosted: Tue Dec 18, 2007 7:09 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
hi all,
I have a question about object state.

I have a detached objet I'd like to reattach to the Session and it's persistence context.

here is the snipped code to do that.


Code:
...
Session session=sessionFactory.openSession;
Transaction tx=sessionFactory.beginTransaction();
session.lock(article,LockMode.NONE);
article.setDescription("new desc");
txcommit();
session.close();



At the end of this I assume that my article has been reassociated to the session and it's state is no more detached.
Does it means that it's state is now persistent even if I know that no database hit has been performed.

thanks in advance.
Meissa


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.