These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: C3P0 and JNDI DataSource
PostPosted: Fri Jun 15, 2007 1:03 pm 
Newbie

Joined: Fri Jun 15, 2007 12:50 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.