-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to make persistent as detached without close session?
PostPosted: Tue Apr 24, 2007 5:03 am 
Newbie

Joined: Wed Nov 02, 2005 10:49 pm
Posts: 12
Dear all,

How to make persistent POJO as detached one without close the session?
according to this article - Generic Data Access Objects, is it possible to add another method
Code:
void makeDetached(T entity);
or more intuitive one:
Code:
T findById(ID id, boolean detached);
with internal implementation that keeping the session opening?

I need some object to be detached, but some others to be persistented, but all of them derived from the same session of the current thread, can anybody give me some suggestions? I think open/close session too frequently is not a good design decision and impractical..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 5:10 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
>>> How to make persistent POJO as detached one without close the session?
session.evict(persistentObject) ;

-------------------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.