Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: Oracle connection timeout

 
xerix bit
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folk,

Afer 8 hours of inactivity (ex. during night) connection close and my application stop to work...

Anyone know how to obtain the same as "jdbc:mysql:/localhost/mydb?autoReconnect=true" with oracle jdbc driver? Assuming actually, even with MySql, using the autoReconnect parameter is not recommended (http://www.theserverside.com/news/thread.tss?thread_id=24137#111947).

I don't use Hibernate connection pool but DBCP (with tomcat) and this not help:
"<property name="connection.autoReconnect">true</property>": after 8 hours of inactivity I get "connection error" exception.

Can c3p0 help?
<property name="c3p0.idle_test_period">100</property>
Is c3p0 really "enterprise ready"?

Here my hibernate.cfg.xml file:



I use a JNDI resource with this "context.xml" configuration:



but it doesn't seem to work!
From Tomcat LOG:




I'm discouraged but I cannot think that a so basic thing is too difficult to setup! (
[ February 15, 2008: Message edited by: xerix bit ]
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this, especially the validationQuery, testOnBorrow, testWhileIdle, timeBetweenEvictionRunsMillis and the related properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic