OSDN Git Service

protected void finalize() {
authorBruce Momjian <bruce@momjian.us>
Mon, 4 Jun 2001 20:10:41 +0000 (20:10 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 4 Jun 2001 20:10:41 +0000 (20:10 +0000)
        close();
}

in LargeObject.java so that the db resources are released when it is
garbage collected or am I missing something?

Philip Crotwell

src/interfaces/jdbc/org/postgresql/largeobject/LargeObjectManager.java

index 07aafee..8fff6e4 100644 (file)
@@ -120,7 +120,15 @@ public class LargeObjectManager
     res.close();
     DriverManager.println("Large Object initialised");
   }
-  
+
+  /*
+   * Added to free resources during garbage collection,
+   * Philip Crotwell <crotwell@seis.sc.edu>
+   */
+  protected void finalize() {
+    close();
+  }
+
   /**
    * This opens an existing large object, based on its OID. This method
    * assumes that READ and WRITE access is required (the default).