-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sinoea,

sinoea kaabi wrote:
>                 } finally {
>                     results.close();
>                 }
>                 
>             } finally {
>                 statement.close();
>             }
>             
>         } finally {
>             connection.close();
>         }

I typically put this all together so I don't have too many try/catch
blocks when they're really not required:

Connection conn = null;
Statement statement = null;
ResultSet results = null;

try
{
...
}
catch (SQLException ...)
{
...
}
... other exceptions ...
finally
{
  if(null != results)
    try { results.close(); } catch (SQLException sqle)
        { ... log exception ... }

  if(null != statement)
    try { statement.close(); } catch (SQLException sqle)
        { ... log exception ... }

  if(null != connection)
    try { connection.close(); } catch (SQLException sqle)
        { ... log exception ... }
}

Remember that it's important to put try/catch blocks around the "close"
invocations -- and make sure to log any errors you get. Otherwise, a
SQLException from closing your connection could mask a more serious
exception occurring elsewhere.

>          removeAbandoned="true"
>          removeAbandonedTimeout="60"
>          logAbandoned="true"

You might also want to set:

           validationQuery="SELECT 1"

Are you not seeing any log messages about abandoned connections?
"logAbandoned" should be enabling that.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjRdsUACgkQ9CaO5/Lv0PDz5QCfXKQp7Koz/OFmEZm68exHTxFV
YMAAn2EPmXYtrS+eHFGx39Bp90TX4lOK
=8euf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to