There is a method you can check if your code leaves connections open.
From web site http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Common%20Problems


==>
There is a solution to this problem. The Jakarta-Commons DBCP can be configured to track and recover these abandoned dB connections. Not only can it recover them, but also generate a stack trace for the code which opened these resources and never closed them.


To configure a DBCP DataSource so that abandoned dB connections are removed and recycled add the following paramater to the ResourceParams configuration for your DBCP DataSource Resource:



<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>


When available db connections run low DBCP will recover and recyle any abandoned dB connections it finds. The default is false.


Use the removeAbandonedTimeout parameter to set the number of seconds a dB connection has been idle before it is considered abandoned.



            <parameter>
              <name>removeAbandonedTimeout</name>
              <value>60</value>
            </parameter>
        
                        
The default timeout for removing abandoned connections is 300 seconds.

The logAbandoned parameter can be set to true if you want DBCP to log a stack trace of the code which abandoned the dB connection resources.



            <parameter>
              <name>logAbandoned</name>
              <value>true</value>
            </parameter>
        
                        
The default is false.
==>

--
John Zoetebier
Web site: http://www.transparent.co.nz

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



Reply via email to