• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can we set connection timeout through Hibernate without using C3P0?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!..


 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic