-->
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: JDBC Connection not released if an error occur
PostPosted: Wed Oct 06, 2004 7:57 am 
Newbie

Joined: Wed Jan 21, 2004 5:09 am
Posts: 11
Hi.

I'm using Hibernate v 2.1.6.

I use a custom jdbc connection provider.
Everything works nice with it except one :

When an error occur on a query made by Hibernate, the connection is not returned to the pool.
My pool is instructed to create at most xx connections so, after xx Hibernate SQLException, the application is down.

I suppose it runs as designed to stop using a potential dirty connection, but my pool already do that and I'm not sure it is hibernate's job to do it.

Also, even in this case, I don't understand why the connection is not, at least, closed ? (therefore, I saw that all PreparedStatement created are correctly closed).

Maybe there is an option or a way to wrap around ?

Thanks in advance for any help.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 8:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
In addition to the getConnection() method, the ConnectionProvider interface also defines the closeConnection() method. Its up to the implementation (i.e., your code) to do whatever needs to get done when Hibernate says its done with the connection.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 9:35 am 
Newbie

Joined: Wed Jan 21, 2004 5:09 am
Posts: 11
steve wrote:
In addition to the getConnection() method, the ConnectionProvider interface also defines the closeConnection() method. Its up to the implementation (i.e., your code) to do whatever needs to get done when Hibernate says its done with the connection.


Ok, I understand this and my closeConnection() returns the connection to the pool.
But the problem is that when an SQL error occur, closeConnection() is not called !!!

Mike


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.