-->
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.  [ 4 posts ] 
Author Message
 Post subject: Flush cached objects
PostPosted: Thu Sep 04, 2003 5:03 am 
Newbie

Joined: Thu Sep 04, 2003 4:59 am
Posts: 5
Hi,

I currently use only one session object, which is disconnected and reconnected.
Is it possible to only flush one object in the session cache when calling "session.flush()", or all cached objects are flushed in database ?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 5:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
What do you mean you "use one Session object"?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 8:27 am 
Newbie

Joined: Thu Sep 04, 2003 4:59 am
Posts: 5
gavin wrote:
What do you mean you "use one Session object"?


I mean my persistence service is a singleton object which manages only one session java object.
This session is opened and disconnected and reconnected and closed.
So the cache contains all my business objects.
When I do the "flush()", all these business instances are flushed in database, whenever I only need to persist one instance...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 10:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I think the documentation is pretty clear on the fact that this is the wrong way to use Hibernate!


Sessions are usually per-request.


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