-->
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.  [ 3 posts ] 
Author Message
 Post subject: Get number of open sessions
PostPosted: Thu Jul 01, 2004 12:37 am 
Regular
Regular

Joined: Sun Jan 18, 2004 9:43 am
Posts: 50
Hi all

how can I get the number of open sessions ?? Because I want to monitor if the program in production has any unclosed sessions.

Thanks !

Edmond

_________________
Edmond Hung
Credit Card DNA Security System (Holdings) Ltd.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 02, 2004 12:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Sessions are not "managed" objects, meaning Hibernate does not keep track of opened sessions; that is the applications responibility.

However, this should be easy enough to set up. The best approach would depend on your exact setup, but there are a number of ways to implement this.


Top
 Profile  
 
 Post subject: Thread local pattern
PostPosted: Sun Jul 04, 2004 1:22 am 
Regular
Regular

Joined: Sun Jan 18, 2004 9:43 am
Posts: 50
steve wrote:
Sessions are not "managed" objects, meaning Hibernate does not keep track of opened sessions; that is the applications responibility.

However, this should be easy enough to set up. The best approach would depend on your exact setup, but there are a number of ways to implement this.



I am using the Thread Local pattern to create one Session for every thread. Hovever, I am afraid some threads died or some other reasons didn't close the session because there are a variety of clients accessing the database and opening session and different clients are developed by different team members. I want to trace if there any unclosed session when the system is in the production.

As you said, there are a number of ways to implement this. Could you please give me some hint? I don't really know how to access the thread's local data.


Thanks for your help!

Edmond

_________________
Edmond Hung
Credit Card DNA Security System (Holdings) Ltd.


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