POResultSet:
BF [ 1874419 ] JDBC Statement not close in a finally block -more protection added (just in case)
This commit is contained in:
parent
03a72d738c
commit
c1fa0d16c2
|
@ -41,7 +41,7 @@ public class POResultSet<T extends PO> {
|
|||
/** Current fetched PO */
|
||||
private T currentPO = null;
|
||||
/** Should we close the statement and resultSet on any exception that occur ? */
|
||||
private boolean closeOnError = false;
|
||||
private boolean closeOnError = true;
|
||||
|
||||
/**
|
||||
* Constructs the POResultSet.
|
||||
|
@ -86,6 +86,7 @@ public class POResultSet<T extends PO> {
|
|||
if ( resultSet.next() ) {
|
||||
return (T) table.getPO(resultSet, trxName);
|
||||
} else {
|
||||
this.close(); // close it if there is no more data to read
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue