You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2003/11/27 13:51:53 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer ResultSetAndStatement.java
arminw 2003/11/27 04:51:53
Modified: src/java/org/apache/ojb/broker/accesslayer
ResultSetAndStatement.java
Log:
log error if resources are not closed when
class is finalized
Revision Changes Path
1.8 +12 -2 db-ojb/src/java/org/apache/ojb/broker/accesslayer/ResultSetAndStatement.java
Index: ResultSetAndStatement.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ResultSetAndStatement.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ResultSetAndStatement.java 27 Nov 2003 12:06:58 -0000 1.7
+++ ResultSetAndStatement.java 27 Nov 2003 12:51:53 -0000 1.8
@@ -65,7 +65,7 @@
/**
* Intern used wrapper for {@link Statement} and {@link ResultSet} instances.
- *
+ *
* @version $Id$
*/
public class ResultSetAndStatement
@@ -128,4 +128,14 @@
}
}
}
+
+ protected void finalize() throws Throwable
+ {
+ super.finalize();
+ if(!isClosed && (m_stmt != null || m_rs != null))
+ {
+ log.error("** Associated resources (Statement/ResultSet) not closed!" +
+ " This could lead in leaking resources **");
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org