I am pretty sure I have upgraded all jars. In fact, as I could see proxool.jar is the same. Only hibernate2.jar is different.
I have debugged ProxoolConnectionProvider class and as I could see in 2.1.3, if proxool properties could not be found then hibernate properties would be used for configuring Proxool. Since I don't use separate proxool configuration (all is done in hibernate.cfg.xml) I guess Hibernate 2.1.3 would use proxool properties defined in hibernate config file. There is a method extractProxoolProperties which is called to get those properties from configure() method.
In Hibernate 2.1.4, there is still method extractProxoolProperties() but it is never called. So if I understood this correctly, proxool properties from hibernate files are not used for Proxool configuration and that's why I am getting error.
Is this a bug or is it left by intention? Am I required to use separate proxool configuration?
Here is my hibernate configuration file:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory >
<!-- properties -->
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="show_sql">false</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">webinfo</property>
<property name="connection.password">desig6</property>
<property name="connection.url">jdbc:oracle:thin:@10.16.64.14:1521:orc1</property>
<property name="connection.provider_class">net.sf.hibernate.connection.ProxoolConnectionProvider</property>
<property name="cglib.use_reflection_optimizer">true</property>
<property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="cache.use_query_cache">true</property>
<property name="use_outer_join">false</property>
<property name="proxool.maximum-connection-count">5</property>
<property name="proxool.minimum-connection-count">3</property>
<property name="proxool.test-before-use">10s,15m</property>
<!--
<property name="c3p0.max_size">5</property>
<property name="c3p0.min_size">3</property>
<property name="c3p0.statistics">900</property>
<property name="c3p0.max_statements">100</property>
-->
<!-- mapping files -->
<mapping resource="Application.hbm.xml"/>
<mapping resource="Entity.hbm.xml"/>
<mapping resource="Description.hbm.xml"/>
<mapping resource="Attribute.hbm.xml"/>
<mapping resource="Relationship.hbm.xml"/>
<mapping resource="Table.hbm.xml"/>
<mapping resource="View.hbm.xml"/>
<mapping resource="Column.hbm.xml"/>
<mapping resource="Domain.hbm.xml"/>
<mapping resource="Function.hbm.xml"/>
<mapping resource="Module.hbm.xml"/>
<mapping resource="Term.hbm.xml"/>
</session-factory>
</hibernate-configuration>
And here is error I got when I use Hibernate 2.1.4. Remeber, there is no such error with Hibernate 2.1.3:
Code:
...
(cfg.SettingsFactory 62 ) Use outer join fetching: false
(connection.ConnectionProviderFactory 53 ) Initializing connection provider: net.sf.hibernate.connection.ProxoolConnectionProvider
(transaction.TransactionManagerLookupFactory 33 ) No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
(cfg.SettingsFactory 95 ) Could not obtain connection metadata
java.sql.SQLException: The url cannot be null
at java.sql.DriverManager.getConnection(DriverManager.java:489)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at net.sf.hibernate.connection.ProxoolConnectionProvider.getConnection(ProxoolConnectionProvider.java:55)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at yu.nbs.metadata.persistence.HibernateSession.configureSessionFactory(HibernateSession.java:83)
at yu.nbs.metadata.persistence.HibernateSession.getSessionFactory(HibernateSession.java:65)
at yu.nbs.metadata.persistence.HibernateSession.getCurrentSession(HibernateSession.java:45)
at yu.nbs.metadata.persistence.BaseDAO.getSession(BaseDAO.java:231)
at yu.nbs.metadata.persistence.BaseDAO.retrieveObj(BaseDAO.java:78)
at yu.nbs.metadata.persistence.ApplicationDAO.getApplication(ApplicationDAO.java:25)
at yu.nbs.metadata.persistence.ApplicationDAOTest.testGetApplication(ApplicationDAOTest.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
(cfg.SettingsFactory 102 ) Use scrollable result sets: false
(cfg.SettingsFactory 105 ) Use JDBC3 getGeneratedKeys(): false
...