db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattba...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer PkEnumeration.java
Date Sun, 02 Feb 2003 03:31:17 GMT
mattbaird    2003/02/01 19:31:17

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        PkEnumeration.java
  Log:
  remove temporary variable, and add finalize to release leaked resources.
  
  Revision  Changes    Path
  1.8       +9 -4      jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/PkEnumeration.java
  
  Index: PkEnumeration.java
  ===================================================================
  RCS file: /home/cvs//jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/PkEnumeration.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PkEnumeration.java	26 Jan 2003 12:30:09 -0000	1.7
  +++ PkEnumeration.java	2 Feb 2003 03:31:17 -0000	1.8
  @@ -113,8 +113,7 @@
        */
       public PkEnumeration(Query query, ClassDescriptor cld, Class primaryKeyClass, PersistenceBroker
broker)
       {
  -        ResultSetAndStatement rsAndStmt = broker.serviceJdbcAccess().executeQuery(query,
cld);
  -        this.resultSetAndStatment = rsAndStmt;
  +        this.resultSetAndStatment = broker.serviceJdbcAccess().executeQuery(query, cld);
           this.classDescriptor = cld;
           this.m_statementManager = broker.serviceStatementManager();
           // get a contructor object that can be used to build instances of class primaryKeyClass
  @@ -134,7 +133,6 @@
               LoggerFactory.getDefaultLogger().error(e);
               throw new PersistenceBrokerException(e);
           }
  -
       }
   
       /**
  @@ -234,4 +232,11 @@
           }
       }
   
  +	/**
  +	 * protection just in case someone leaks.
  +	 */
  +	protected void finalize()
  +	{
  +		releaseDbResources();
  +	}
   }
  
  
  

Mime
View raw message