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...