-->
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.  [ 1 post ] 
Author Message
 Post subject: There are no long transaction practice found here
PostPosted: Mon Feb 28, 2005 11:03 am 
Beginner
Beginner

Joined: Sat Jan 31, 2004 10:09 am
Posts: 26
Hibernate version:2.1.8

I want to talk about the session used with Tomcat.

There are many articles that are examples about using ThreadLocal in Servlet or Filter. And all the articles recommands us CLOSE session before leaving the current thread.

I followed the recommandation and examples, but do they just work in simple situation? If an entity has one-to-many items. In first HTTP request, this entity was loaded. But when I want to use its items in the second HTTP request. I will get "session was closed" exception. This exception was occured because this entity was associated with the previous session which has been closed in first HTTP request.

I followed the "HibernateUtil" example http://www.hibernate.org/hib_docs/reference/en/html/quickstart.htmland session was closed before leaving my Filter. It works fine except the problem I mentioned above.

How do I solve this problem? Any suggestion?
Thanks,
Matt


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.