-->
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.  [ 5 posts ] 
Author Message
 Post subject: How can I keep Session open after committing a transaction
PostPosted: Sat Feb 04, 2006 5:48 am 
Newbie

Joined: Mon Jan 02, 2006 1:40 am
Posts: 9
Hibernate version: 3.1

Hi friends,

I am using the default current session, and whenever I issue a commit, the session gets closed, and I am not able to refer the object any more. I want to know if there is any way which can allow me to commit an object and still keep me connected to the object and the session.

Thanks.

Mirza.

_________________
Mirza M.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 04, 2006 10:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
sure. use a different context implementation. they are pluggable.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 05, 2006 1:19 am 
Newbie

Joined: Mon Jan 02, 2006 1:40 am
Posts: 9
Thanks Steve. But can you please help me further by giving some example etc.

regards,

Mirza.

_________________
Mirza M.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 05, 2006 3:04 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
The SessionContext implementation is pluggable from 3.1 and both ThreadLocalSessionContext and JTASessionContext(default implementations) -- both have isAutoCloseEnabled to be true. But you can subclass one of these implementations and make this false and use that as your sessioncontext implementation.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 05, 2006 7:36 am 
Newbie

Joined: Mon Jan 02, 2006 1:40 am
Posts: 9
Thank you very much Rajasaur. I am grateful to you. I found it very helpful.

_________________
Mirza M.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

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.