• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we set connection timeout through Hibernate without using C3P0?

 
Suresh Gopi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I want to close the db connection after 'n' seconds of idle time.

In my hibernate config file, I'm getting the datasource reference fom JNDI.
Is it possible to set connection timeout value?


It looks like C3P0 connection pool implementation allows use to set the connection timeout?

Can i use both? i.e App server connection pool (datasource from JNDI) and C3P0 connection ppol mechanism?


(It is web app runs on App server.)

Please provide some pointers... Thanks in Advance!..


 
Mudit Srivastava
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using the JNDI App Server Pooling, then C3P0 is not required in your configuration file. which application server are you using ?
 
Suresh Gopi
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply first Mudit!

i'm using Weblogic 8.1
 
Mudit Srivastava
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should be a piece a cake then, just remove the c3p0 settings from the hibernate.cfg.xml and you're good to go.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic