Skip to content

Commit f170e61

Browse files
author
Barry Lind
committed
fixed bug reported by Michael, Dietrich (mdt@emdete.de) where a large object handle was being used after the end of the transaction and thus resulting in an error.
1 parent fe92e01 commit f170e61

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ protected LargeObject(Fastpath fp, int oid, int mode) throws SQLException
9292
/* Release large object resources during garbage cleanup */
9393
protected void finalize() throws SQLException
9494
{
95-
close();
95+
//This code used to call close() however that was problematic
96+
//because the scope of the fd is a transaction, thus if commit
97+
//or rollback was called before garbage collection ran then
98+
//the call to close would error out with an invalid large object
99+
//handle. So this method now does nothing and lets the server
100+
//handle cleanup when it ends the transaction.
96101
}
97102

98103
/*

0 commit comments

Comments
 (0)