-->
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: session-per-http-session is thread safe?
PostPosted: Thu Jan 25, 2007 2:01 pm 
Newbie

Joined: Wed Sep 06, 2006 2:33 pm
Posts: 13
i've read some articles about using long term hibernate session and disconnect() at end of each http request. But is this thread safe? if client sends two request using same httpsessionid (e.g. user opens two browser window), there is racing condition in sharing the hibernate session.
According to doc, hibernate session is not thread safe.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 25, 2007 3:41 pm 
Regular
Regular

Joined: Sun Sep 17, 2006 2:48 am
Posts: 81
Location: California
You can avoid this issue by session <-> thread relation as 1:1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 8:20 pm 
Newbie

Joined: Wed Sep 06, 2006 2:33 pm
Posts: 13
somu wrote:
You can avoid this issue by session <-> thread relation as 1:1


you mean 1:1 for hibernate session <-> tomcat thread? That is a typical "hibernate-session-per-http-request" model. Tthe "hibernate-session-per-http-session" is useless?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 11:40 pm 
Newbie

Joined: Thu Jan 18, 2007 12:55 am
Posts: 10
I am not sure, why it is necessary to bring hibernate session to the web(servlet) Layer. If Data Access layer is designed properly , there is no need to bring hibernate session in the weblayer.


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.