-->
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: JDBCPOOL connection properties ignored when using c3p0
PostPosted: Tue Oct 19, 2010 10:17 am 
Newbie

Joined: Tue Oct 19, 2010 10:09 am
Posts: 1
Hi…

I have a JDBCPOOL defined in my easybeans.xml:

Code:
<jdbcpool jndiName="jdbc_1"
          username="username"
          password="pass"
          url="jdbc:oracle:thin:@localhost:1521:orcl"                                           
          driver="oracle.jdbc.OracleDriver"
          poolMin="2"
          poolMax="10"/>


Everything worked fine until I needed to use c3p0.
The JDBCPOOL connection properties are ignored when I add the following line to my persistence.xml:

Code:
<property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />


Here is my persistence.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
    <persistence-unit name="MYAPP" transaction-type="JTA">
        <jta-data-source> jdbc_1</jta-data-source>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
            <property name="hibernate.hbm2ddl.auto" value="validate"/>
            <property name="hibernate.show_sql" value="false" />
           
            <!—Problem starts when I add this -->
            <property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />
            <property name="hibernate.c3p0.max_size" value="100" />
            <property name="hibernate.c3p0.min_size" value="0" />
            <property name="hibernate.c3p0.acquire_increment" value="1" />
            <property name="hibernate.c3p0.max_statements" value="0" />
            <property name="hibernate.c3p0.timeout" value="100" />
            <property name="hibernate.c3p0.idle_test_period" value="200" />                                       
        </properties>
    </persistence-unit>
</persistence>


Note that if I add the connection properties (example below) along with the ‘hibernate.connection.provider_class’ it works, but that solution is not acceptable in my case because this file (persistence.xml) will be inside my data module (JAR) and the connection properties should be configurable in my easybeans.xml (present in my configuration file).

Code:
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:orcl" />
<property name="hibernate.connection.username" value="username" />
<property name="hibernate.connection.password" value="pass" />



Any help on what is going on or how can I solve the problem would be very appreciated.

Thanks...


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.