I'm trying to use Proxool as my connection pool in Hibernate 2.1.1, but I can't figure out how to configure it. My hibernate.cfg.xml looks like this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/projectlink?useUnicode=true&characterEncoding=UTF8</property>
<property name="connection.username">user</property>
<property name="connection.password">password</property>
<property name="show_sql">true</property>
<property name="proxool.pool_alias">pool1</property>
<property name="proxool.house-keeping-sleep-time">30000</property>
<property name="proxool.house-keeping-test-sql"></property>
<property name="proxool.maximum-connection-count">4</property>
<property name="proxool.maximum-connection-lifetime">4</property>
<property name="proxool.simultaneous-build-throttle">2</property>
<property name="proxool.maximum-active-time">500</property>
<property name="proxool.minimum-connection-count">2</property>
<property name="proxool.fatal-sql-exception"></property>
<property name="proxool.prototype-count"></property>
<property name="proxool.statistics"></property>
<property name="proxool.recently-started-threshold"></property>
<property name="proxool.overload-without-refusal-lifetime"></property>
<!-- Mapping files -->
<mapping resource="Acl.hbm.xml"/>
<mapping resource="Admin.hbm.xml"/>
<mapping resource="Media.hbm.xml"/>
<mapping resource="MediaCollection.hbm.xml"/>
<mapping resource="Metadata.hbm.xml"/>
<mapping resource="Peer.hbm.xml"/>
<mapping resource="Role.hbm.xml"/>
<!--mapping resource="StorageService.hbm.xml"/-->
<mapping resource="User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
(I've also tried with property names like hibernate.proxool.*). With this config file Hibernate will use the built-in connection pool and not Proxool.
I also tried to use an exteranl proxool.properties file, but I always get the following exception:
2004-01-06 09:31:45,484 INFO [main] (@) (ProxoolConnectionProvider.java:111) - Configuring Proxool Provider using Properties File: proxool.properties
2004-01-06 09:31:45,515 FATAL [main] (@) (ProxoolConnectionProvider.java:125) - Proxool Provider unable to load load Property configurator file: proxool.properties
2004-01-06 09:31:45,531 ERROR [main] (@) (PLServer.java:295) - Hibernate error.
net.sf.hibernate.HibernateException: Proxool Provider unable to load load Property configurator file: proxool.properties
at net.sf.hibernate.connection.ProxoolConnectionProvider.configure(ProxoolConnectionProvider.java:126)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:64)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1091)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:737)
Thanks
--
Per Thomas