-->
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: ICurrentSessionContext
PostPosted: Wed Aug 08, 2007 5:50 pm 
Newbie

Joined: Wed Aug 08, 2007 5:39 pm
Posts: 2
Location: Atlanta, GA
Hibernate version: 1.2.0 GA


For version 1.2.0, can a ICurrentSessionContext handle more than thread at a time? It seems that from the docs and code that only one instance of this class is instantiated for a given SessionFactory which isn't thread-safe.

Thanks,

LCranf


Top
 Profile  
 
 Post subject: Re: ICurrentSessionContext
PostPosted: Thu Aug 09, 2007 4:43 pm 
Newbie

Joined: Wed Aug 08, 2007 5:39 pm
Posts: 2
Location: Atlanta, GA
Essentially, I want to be able to use the ISessionFactory.GetCurrentSession() method which will allow me to grab the "current" Session from anywhere in code for a given thread. From the docs, it seems by implementing the ICurrentSessionContext interface I can "bind/unbind" ISession instances to a context (thread) and register that interface via a configuration setting in my app.config via the "hibernate.current_session_context_class" parameter. My question is this fully implemented and thread-safe? From the source, it seems that only one instance of a ICurrentSessionContext is associated to a SessionFactory at run-time which doesn't seem to me to be thread-safe. Am I correct or am I missing something?

Thanks,

LC


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.