-->
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: Reusing sessions
PostPosted: Fri Nov 19, 2004 4:04 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 9:50 am
Posts: 43
Hello all,
If i want to reuse existing sessions to the same db to hand them out to different clients, is it sufficient to do session.flush() and session.clear() or do i need to do anything else?

thank you,

| eg |


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 6:15 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
to reuse existing sessions to the same db to hand them out to different clients


please reformulate, if you mean many concurrent clients using the same session: no impossible

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2004 7:00 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 9:50 am
Posts: 43
No, definitely not concurrent, only one client at a time, kind of like pooling.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 3:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
if they are not concurrent... why not but getting a new session from the factory costs _nothing_ and is more secure.
Just configure the connection pooling size = 1

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 9:39 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 9:50 am
Posts: 43
tnx. my only concern was that it seems like there is a whole bunch of collections initialized when a session is created, and with a large number of clients with short sessions, i thought i'd get killed on garbage collection.


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.