Thanks a lot for the reply.  I am releasing all the connections and other
resources in my entire application.
I am using Tomcat4.1.30 and Oracle 8i..
But i have one question though,
does
Connection con = dataSource.getConnection();
 ensures that we are creating connection pool and getting connection from
the pool?????
i noticed that there are several classes in DBCp like Pooled Connection
etc., can we use those ...

-----Original Message-----
From: Robert Bateman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 3:59 PM
To: Tomcat Users List
Subject: Re: removeAbandoned in DBCP


On Wednesday 22 September 2004 03:28 pm, Shilpa Nalgonda wrote:
> Hi,
> My connection pool works if i set the removeAbandon parameter to true, but
> i still do not understand why it works that way,
> can someone suggest...can i use that parameter...
>
> <parameter>
>           <name>removeAbandoned</name>
>           <value>true</value>
> </parameter>
> <parameter>
>             <name>removeAbandonedTimeout</name>
>             <value>0</value>
> </parameter>
>

I have both parameters in my pool definition and they work fine.  I did set
my
Timeout a bit bigger though.  In my prod. TC app, I have set (for MySQL,
ymmv):

<!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit. -->
<parameter>
        <name>maxActive</name>
        <value>100</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 15 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely. -->
<parameter>
        <name>maxWait</name>
        <value>15000</value>
</parameter>
<!-- Validation Query to insure our connection is still valid. -->
<parameter>
        <name>validationQuery</name>
        <value>SELECT version()</value>
</parameter>
<!-- Make sure we test each and every connection before we borrow
         it to see if it is still valid. -->
<parameter>
        <name>testOnBorrow</name>
        <value>true</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit. -->
<parameter>
        <name>maxIdle</name>
        <value>100</value>
</parameter>
<parameter>
        <name>removeAbandoned</name>
        <value>true</value>
</parameter>
<!--Use the removeAbandonedTimeout parameter / seconds.-->
<parameter>
        <name>removeAbandonedTimeout</name>
        <value>60</value>
</parameter>
<parameter>
        <name>logAbandoned</name>
        <value>true</value>
</parameter>

Also, I noticed on my last app that I was forgetting to release the pooled
connection and I eventually ran out of entries.  You might want to double
check you are releasing/closing your connection.

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to