I am using a ConnectionPool in my servlets and I have a question. I want to
return the connection to the pool whether or not an exception has occured.

Is the finally below ever reached if the exception is caught:

        ConnectionPool cp =
ConnectionPoolManager.getInstance().getPool(context_id);
        Connection conn = cp.getConnection();

        try {
                //some sql
        } catch (SQLException e) {
                throw e;
        } finally {
                cp.freeConnection(conn);
        }


or do it need:

        ConnectionPool cp =
ConnectionPoolManager.getInstance().getPool(context_id);
        Connection conn = cp.getConnection();

        try {
                //some sql
                cp.freeConnection(conn);
        } catch (SQLException e) {
                cp.freeConnection(conn);
                throw e;
        }


--jim

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to