Maybe try adding this, too as an attribute in the Resource tag.

timeBetweenEvictionRunsMillis="-1" 

-----Original Message-----
From: Jason Britton [mailto:jbritto...@gmail.com] 
Sent: Wednesday, November 03, 2010 9:05 AM
To: Tomcat Users List
Subject: Re: Connection Leak

Since you're using an Oracle database - another way to identify areas in your 
code that aren't closing connections.  In the sql below substitute YOURDBUSER 
with the name of the database user your connections connect to your database 
with and YOURWEBSERVER with the name of your webserver.  The results of the sql 
query will give you the last executed sql for each of the open connections.  
Then search your code for where this sql is being executed and double check you 
are closing the connection appropriately.

SELECT username, machine, oc.sql_text, COUNT(*) open_statements FROM v$session 
vs, v$open_cursor oc WHERE username = 'YOURDBUSER' AND machine = 
'YOURWEBSERVER' AND oc.sid = vs.sid GROUP BY username, machine, oc.sql_text 
ORDER BY open_statements DESC



On Wed, Nov 3, 2010 at 6:44 AM, Ziggy <zigg...@gmail.com> wrote:

> Hi All,
>
> <Resource name="myConn" auth="Container"
>              type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver"
>              url="jdbc:oracle:thin:@10.10.10.10.:1521:mydb"
>              username="username" password="password" maxActive="500"
> maxIdle="50"
>              maxWait="-1" removeAbandoned="true"
> removeAbandonedTimeout="60" logAbandoned="true"
> accessToUnderlyingConnectionAllowed="true"
> />
>
> I am trying to find out areas of the application where connections are 
> NOT being closed. I added the removeAbandoned and logAbandoned clauses 
> in my context file but if i check v$session on oracle it is still 
> showing the same number of connections active even after 60 seconds. 
> Is there something wrong in the configuration above?
>
>
> How exactly does it abandone the connections? what triggers it>?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to