Re: Postgres Connection pool
Allan G. Ramirez <agramirez <at> exist.com>
2007-11-02 00:09:39 GMT
Will Hartung wrote:
Hi all,
We have this in our
jetty.xml
<New id="db"
class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/db</Arg>
<Arg>
<New
class="org.postgresql.ds.PGSimpleDataSource">
<Set
name="portNumber">5432</Set>
<Set
name="password">password</Set>
<Set
name="serverName">host</Set>
<Set
name="databaseName">dbname</Set>
<Set
name="user">username</Set>
</New>
</Arg>
</New>
And we use JNDI to fetch
the resource.
I was wondering what we
should change this to in order to
use a connection pool implementation for this resource instead of the
direct
connections that we’re using now. I don’t see anything about
connection pools on the web site.
Thanx!
Regards,
Will
Hartung
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support
Hi Will,
I read the
PGSimpleDataSource class
docu. It doesn't support connection pooling. I'm using ComboPooledDataSource
of c3p0 in my spring applications because it supports JDBC3 statement
and connection pooling. So I ported theconfiguration to jetty
<New id="db"
class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/dbPostgres</Arg>
<Arg>
<New
class="com.mchange.v2.c3p0.ComboPooledDataSource">
<Set name="driverClass">org.postgresql.Driver</Set>
<Set name="jdbcUrl">jdbc:postgresql://localhost/mydb</Set>
<Set name="user">user</Set>
<Set
name="password">password</Set>
<Set name="initialPoolSize" value="5" />
<Set name="minPoolSize" value="0" />
<Set name="acquireIncrement" value="10" />
<Set name="maxPoolSize" value="20" />
<Set name="maxIdleTime" value="300" />
<Set name="loginTimeout" value="500" />
</New>
</Arg>
</New>
Regards,
Allan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jetty-support mailing list
Jetty-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jetty-support