-->
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.  [ 3 posts ] 
Author Message
 Post subject: How do I use Proxool?
PostPosted: Tue Jan 06, 2004 4:43 am 
Newbie

Joined: Tue Nov 18, 2003 11:56 am
Posts: 16
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&amp;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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 06, 2004 7:53 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
Try putting this property in your config file:
Code:
<property name="hibernate.connection.provider_class">net.sf.hibernate.connection.ProxoolConnectionProvider</property>


Also, I don't think you need the pool_alias property defined (it'll get set to a newly generated one regardless).

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 9:28 am 
Newbie

Joined: Tue Nov 18, 2003 11:56 am
Posts: 16
Thanks, that worked.

_________________
Thanks
Per Thomas


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

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.