Hibernate-Version: 3.1.3
C3P0-0.9.0
Tomcat 5.5
Postgres 8.1 + 8.2
My question concerns automatically reconnecting to postgres in the event that it restarts.
I understand that C3P0 offers this automatically and have been reading previous posts but am still not able to reconnect to the database.
I'm using a JNDI DataSource specified in Tomcats server.xml as
<Resource
name="jdbc/DataSource"
description="Data Source"
auth="Container"
driverClass="org.postgresql.Driver"
minPoolSize="10"
maxPoolSize="80"
acquireIncrement="1"
user="user"
password="passwd"
factory="org.apache.naming.factory.BeanFactory"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
jdbcUrl="jdbc:postgresql://localhost:5432/app?autoReconnect=true"
/>
In other postings i've seen reference to also setting up the connection provider in hibernates properties file
hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
Is the connection provider still necessary when using a JNDI DataSource? When I try to configure the connection provider I get exceptions unless I also provide the driver_class, url, username, and password options as well.
I'm currently using C3P0's default settings.
|