-->
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:04 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 9:06 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
HI imsardine,

Plz.. Provide us more context what exactly you want to do that. What is your Business Problem. in Which scenario you feel that session open and close is not good.

For detaching any persistent object (let say obj) you could use session.evict(obj) .

_________________
Dharmendra Pandey


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.