#3 Report unclosed objects

closed
Bill Horsman
5
2003-01-24
2002-09-01
Bill Horsman
No

Log everytime a connection is "closed" (put back in the
pool) without closing the ResultSets and Statements
that were used. Don't automatically close them because
this would encourage sloppy programming.

Discussion

  • Bill Horsman
    Bill Horsman
    2002-12-17

    Logged In: YES
    user_id=91747

    After much discussion, and in compliance of J2EE spec., this
    request has been qualified to: automatically close all
    Statements when the Connection is closed, but leave
    ResultSets to be closed by the user or handled by the
    delegate JDBC Driver. (We have no way of knowing whether the
    ResultSet has been closed anyway).

     
  • Bill Horsman
    Bill Horsman
    2003-01-24

    • labels: --> Pool behaviour
    • assigned_to: nobody --> billhorsman
    • status: open --> closed
     
  • Bill Horsman
    Bill Horsman
    2003-01-24

    Logged In: YES
    user_id=91747

    We've refined this a bit. It turns out that it's really hard
    to spot whether ResultSets have been closed or not. Same
    with Statements. The spec says closing a Statement should
    close all its resource (i.e. ResultSets) anyway.

    What we do is this: when you "close" the connection (put it
    back in the pool) it automatically closes all the statements
    that have been left open. We rely on the delegate JDBC
    driver to close the Statement's ResultSets.