-->
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.  [ 4 posts ] 
Author Message
 Post subject: Connection Exception is NOT being thrown - please help
PostPosted: Mon Apr 30, 2007 2:25 pm 
Newbie

Joined: Mon Apr 30, 2007 2:15 pm
Posts: 2
Location: Novato , CA
i'm not exactly sure that this is the correct place to ask this, but the system uses hibernate (3.2.0.x) for all database transactions and I'm trying to get an error or exception to be thrown.

I'm trying to fix a server recovery issue where we lose the database connection. To reproduce my problem, I have a large table that I query and sort (in a remote oracle box), then in the middle of the transaction, I pull the plug to internet connection.

My problem is that Linux (ubutu 6.10 edgy-eft all updates installed to date) will not recognize that the connection has been lost in teh middle of the transaction and the Application Hangs.

Once I plug the box back in, my interceptors will catch the timeout, and throw the appropriate errors, but I need the system to catch the lost connection either immediately or quickly adn then throw the errors.


has anyone else ran into this problem and if so how did you fix it?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 4:53 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
We also sometimes have the same problems, but didn't have times to find out a solution. We were thinking about configuring the connection pool timeout, if possible, did you try it?

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject: Found a solution.
PostPosted: Tue May 01, 2007 12:35 pm 
Newbie

Joined: Mon Apr 30, 2007 2:15 pm
Posts: 2
Location: Novato , CA
my system is set up on linux kernel 2.6.17 (ubuntu 6.10), and Depending on your datasource and operating system, connection pool timeouts won't always work. in linux the problem is at the driver level. If you're using an oracle database, use the oracle.jdbc.pool.OracleDataSource or whatever extention of that suits you best. set the loginTimeout, then include the property oracle.jdbc.ReadTimeout in the connectionProperties that it passes to your jdbc driver. ** note: i've only tested this out with oracle thin driver


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 12:43 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Try configuring your connection pool to issue a special query every n minutes, something like "select 1 from dual" is fine on Oracle. This way your connection system will detect connection problem if this query becomes unavailable.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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