-->
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: WebSphere 5.1 closing database connections
PostPosted: Thu Aug 19, 2004 6:10 pm 
Newbie

Joined: Thu Aug 19, 2004 5:56 pm
Posts: 1
All,

I am running into the following problem described in the FAQ with WAS 5.1:

Quote:
Unfortunately on WebSphere 5.0 I get the following error message when closing a Hibernate Session:

net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged com.ibm.websphere.ce.cm.StaleConnectionException: Connection is closed

We had this same problem with data source connections in Websphere. We "fixed" it by configuring the data source to "Disable auto connection cleanup". It's a checkbox in the data source setup in Websphere.


I do not seem to be able to find that checkbox anymore, and I know it
was there in 4 (and apparently in WAS 5 according to the FAQ.) Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 1:19 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
I am also running WSAD 5.1.2 and somehow during my testing I find to have the session closed (though session is not null, I guess no database connection). I open the session in "setUp" method and closes it only in "teardown" method, I have no clue why it is being closed. I fixed the problem by adding the following lines of code into my getSession method
(which I do not like)

if(s != null && ! s.isOpen)
s = sessionFactory.OpenSession();

the call cause a new connection to be retrieved from the datasource.

However, since I use session per request, I should not have my session and connections closed unless I specifically call session.close() .

I hope someone has had a better way.


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.