-->
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: Connection automatically closing
PostPosted: Tue Nov 02, 2004 12:11 pm 
Newbie

Joined: Tue Nov 02, 2004 11:56 am
Posts: 2
Hi...I'm using Hibernate 2.1.6 and using a ThreadLocal variable to hold my Session object. I need to initialize an Oracle context (by calling a stored procedure) for all my connections prior to sending any inserts/updates through it.

I first tried creating my own connection, calling the pl/sql procedure from it, and then passing it to openSession -- however, if I do it this way I loose the ability to use second-layer caching.

Therefore, what I decided to do was call openSession(), get the connection using session.connection() and then run the pl/sql from that. For some odd reason, the connection gets closed automatically after a save/update or retrieve. And, the next call to get the Session from the ThreadLocal variable does not re-execute my procedure.

Any assistance would be much appreciated. Thanks!


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.