-->
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: Hibernate and HttpSession
PostPosted: Thu Sep 22, 2005 2:54 pm 
Newbie

Joined: Wed May 25, 2005 8:28 am
Posts: 18
I'm using HttpSession to save a reference to hibernate session in attributes.

During navigation, the session is closed without my command. And I'm facing
exception:

"could not initialize proxy - the owning Session was closed"

How can I solve this problem?

How can I identify from which session a object had been loaded?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 7:00 pm 
Beginner
Beginner

Joined: Sat Sep 17, 2005 10:41 am
Posts: 49
In general, it's bad practice to put "heavy" objects in an HttpSession, particularly ones that involve a system resource such as files or a database connection.

Try using the ThreadLocal Pattern (easy to find via google).


Top
 Profile  
 
 Post subject: look at the managed session stuff as well
PostPosted: Mon Oct 03, 2005 6:17 pm 
Beginner
Beginner

Joined: Thu Dec 09, 2004 7:04 pm
Posts: 26
Location: Denver, CO
Look at the session context stuff at

http://blog.hibernate.org/cgi-bin/blosxom.cgi/Christian%20Bauer/java/sessioncontext.html


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.