-->
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.  [ 8 posts ] 
Author Message
 Post subject: Connections from DataSource + WebSphere
PostPosted: Mon Sep 15, 2003 10:24 am 
Newbie

Joined: Mon Sep 15, 2003 10:07 am
Posts: 8
Location: Stuttgart, Germany
Hi,

I am using Hibernate 2.0.1 with Datasource connections on several Appservers and it works perfectly.
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

After some debugging I realized that WebSphere seems to close the connection after a UserTransaction#commit but Hibernate afterwards in SessionFactoryImpl#closeConnection tries to call #getWarnings on the closed connection which causes the above exception.
Is this a known bug or am I doing something wrong? I saw earlier posts that seemd to be related to the same problem on other WebSphere versions.

Regards,
Ralf


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 10:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
damn, I don't have my websphere install :(

can you please try commenting out the getWarnings() call, and recompile and see what happens?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 11:02 am 
Newbie

Joined: Mon Sep 15, 2003 10:07 am
Posts: 8
Location: Stuttgart, Germany
Hi Gavin,

I changed the code of SessionFactoryImpl#closeConnection as follows and now it works fine


Code:
if (!conn.isClosed()) {
   JDBCExceptionReporter.logWarnings( conn.getWarnings() );
   conn.clearWarnings();
}
connections.closeConnection(conn);


In the past I learned that if you work with IBM tools things often don't work as they seem to work ;-)

Ralf


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
ugggh. this is crap.


Would you please do me a favor and add this as an issue to JIRA?

TIA!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 1:15 pm 
Newbie

Joined: Wed Aug 27, 2003 2:53 pm
Posts: 14
Location: New Jersey
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.

Hope this helps.

Sarah


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 1:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Aaaah. hmmmm. Thanks Sarah. We need to add this to the FAQ.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2003 10:03 am 
Newbie

Joined: Mon Sep 15, 2003 10:07 am
Posts: 8
Location: Stuttgart, Germany
Gavin, Sarah,
unfortunately disabling "auto connection cleanup" does not fully solve the issue :-(
If you use CMP WebSphere does not return connections to the connection pool anymore in this case. Using two different Datasources in a mixed CMP/BMP(Hibernate) scenario does not work either because data access in one transaction should go to the same db connection.
So what can I do? IMHO the problem could be solved if Hibernate would do the Connection#getWarnings() stuff before committing the transaction.

Gavin, I added the issue #HB-337 to JIRA.


Top
 Profile  
 
 Post subject: Connections from DataSource + WebLogic
PostPosted: Wed Sep 24, 2003 2:51 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 4:17 pm
Posts: 27
Location: California, USA
A similar problem occurs with WebLogic 7 and Hibernate 2.0.2. See JIRA HB-360 for a patch.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.