| Author |
Hibernate timeout
|
jay vas
Ranch Hand
Joined: Aug 30, 2005
Posts: 407
|
|
hi guys : Is there a way to set a hibernate database connection timeout, i.e. [code] Configuration c = ... c.setProperty("hibernate.show_sql", "true"); c.setProperty("use_sql_comments","true"); c.setProperty("hibernate.timeout", "10"); [code] ? I have an application that uses hibernate, that hangs for a very long time when the database isnt installed... I'd rather just have it throw a timeout exception. Thanks Jay
|
 |
Pierre Henry
Ranch Hand
Joined: Oct 01, 2003
Posts: 31
|
|
hi, You should try to throw a timeout exception at jdbc level.
|
"A good method shouldn't bypass one screen long"<br />"genius is the knowledge left when one has forgotten everything"
|
 |
Saket Chauhan
Greenhorn
Joined: Jul 15, 2007
Posts: 1
|
|
|
:roll: :roll:
|
Saket Chauhan<br />HCL Infosystem<br />Noida
|
 |
jay vas
Ranch Hand
Joined: Aug 30, 2005
Posts: 407
|
|
|
OK thanks ... how can i configure my jdbc driver that is used by hibernate to throw an timeout exception ? I'm using the commonly used Mysql jdbc driver (com.mysql.jdbc.Driver) class.
|
 |
jay vas
Ranch Hand
Joined: Aug 30, 2005
Posts: 407
|
|
|
I have solved this problem by extending ConnectionProvider.... Anyone needing the code to do so feel free to email me.
|
 |
 |
|
|
subject: Hibernate timeout
|
|
|