-->
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: Websphere, DB2 and Hibernate - Transacted (XA) datasource
PostPosted: Thu Oct 16, 2003 1:28 pm 
Regular
Regular

Joined: Tue Sep 09, 2003 9:37 pm
Posts: 56
Location: Ogden, Utah, USA
I am using Websphere 5, Hibernate 2 and DB2 7.2.

I have a connection leak when running under websphere, but not when running under Tomcat with the same codebase. Under tomcat I'm using a dbcp connection pool and a jndi datasource, so Hibernate shouldn't be doing any pooling. Under Websphere I'm using the COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource which as I understand it is not a "transacted" datasource.

Does Hibernate require a transacted datasource? I have tried using the COM.ibm.db2.jdbc.DB2XADataSource instead, but the application doesn't work right when I use that datasource.

I know Hibernate is not causing the connection leak, but I'm wondering if there are setup requirements for the connection pool that anyone knows of that might affect this?

Thanks for your help!

Jenica


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 10:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The datasource given to Hibernate does not have to be XA transacted.


Top
 Profile  
 
 Post subject: Websphere connection leak
PostPosted: Mon Oct 20, 2003 1:28 pm 
Regular
Regular

Joined: Tue Sep 09, 2003 9:37 pm
Posts: 56
Location: Ogden, Utah, USA
I finally found the cause of our connection leak in Websphere. I wanted to put a note here so that if anyone else runs into this they'll be able to fix it more quickly!!

Hibernate requires that the connection have autocommit=false, and the connection received from Websphere has autocommit = true. So, after retrieving the connection from the pool I set autocommit to false.

If I set autocommit back to true BEFORE returning the connection to the websphere pool, it works perfectly. If I don't, there's a very difficult to diagnose leak!

We're using Websphere 5, DB2 7.2 client, DB2 7.1 Database, and Hibernate 2.0.

Jenica[/list]


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.