tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Stephens" <danma...@gmail.com>
Subject Re: connection pool
Date Mon, 02 Apr 2007 16:36:26 GMT
sorry if someone has already mentioned this, but you will probably have to
add the testOnborrow Parameter. So that also means you have to use the
ValidationQuery, etc... but it(the pool) should try to restablish a
connection at that point.

testOnBorrow will cause some more overhead, but it might resolve your
problem.

here's an example..

<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@<host>:<port>:<sid></value>
</parameter>
<parameter>
<name>username</name>
<value>john</value>
</parameter>
<parameter>
<name>password</name>
<value>doe</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>5</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>5</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>validationQuery</name>
<value>select count(*) from dual</value>
</parameter>
<parameter>
 <name>testOnBorrow</name>
 <value>true</value>
</parameter>

On 3/19/07, Gioia, Michael <Michael.Gioia@childrens.harvard.edu> wrote:
>
> Hi, I'm new to tomcat and have a problem with keeping up the connection
> to the database thru the connection pool.
>
>
>
> Almost every weekend the database gets bumped and the java app that were
> running needs to have tomcat restarted to reconnect to the database thru
> the connection pool.  When we come in on Monday tomcat and the database
> are up and running, but the app will not connect to the database.
>
>
>
> Is there a way to reestablish the connection so our users don't have to
> wait until we come in on Monday to restart tomcat?
>
>
>
> Many Thanks,
>
> MG
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message