>>>>> "TY" == Tim Yates <[EMAIL PROTECTED]> writes:

TY> Hiya!  Try:

'ellau!

TY> ----- Original Message ----- From: Nicolai P Guba
TY> <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:
TY> Thursday, June 21, 2001 10:02 AM Subject: [JBoss-user] closing
TY> PreparedStatements


>> finally { ExtendedJDBC.close( connection, prepStmt, result ); } }
>> 

TY> finally { try { if( result != null ) result.close() ; } catch(
TY> SQLException e ) { } try { if( prepStmt != null ) prepStmt.close()
TY> ; } catch( SQLException e ) { } try { if( connection != null )
TY> connection.close() ; } catch( SQLException e ) { } }

TY> Thats what I'd do....

That's what I did.  Sorry for not supplying the implementation for
that helper.  'ere it is.

    public static void close( Connection c, PreparedStatement s, ResultSet r )
    {
        try {
            if( c != null ){
                c.close();
            }
            if( s != null ){
                s.close();
            }
            if( r != null ){
                s.close();
            }
        }
        catch( SQLException e ){
            throw new EJBException( "ExtendedJDBC: close: " + e.getMessage() );
        }
    }

Now what?  It appears as if the PreparedStatements are being cached
(not necessarily a bad idea) but do these resources get reclaimed by JBoss?

Hmmmm....  Could not find much info about this.

-- 
  Nicolai P Guba    http://www.gnu.org         http://www.frontwire.com
                    mailto:[EMAIL PROTECTED]     mailto:[EMAIL PROTECTED]
                    GSM: +44 (0)7909 960 751   DDI: +44 (0)20 7368 9708

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to