tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Britton <jbritto...@gmail.com>
Subject Re: Connection Leak
Date Wed, 03 Nov 2010 14:05:06 GMT
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 <ziggy25@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>?
>

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