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 */
|
/** Current fetched PO */
|
||||||
private T currentPO = null;
|
private T currentPO = null;
|
||||||
/** Should we close the statement and resultSet on any exception that occur ? */
|
/** Should we close the statement and resultSet on any exception that occur ? */
|
||||||
private boolean closeOnError = false;
|
private boolean closeOnError = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the POResultSet.
|
* Constructs the POResultSet.
|
||||||
|
@ -86,6 +86,7 @@ public class POResultSet<T extends PO> {
|
||||||
if ( resultSet.next() ) {
|
if ( resultSet.next() ) {
|
||||||
return (T) table.getPO(resultSet, trxName);
|
return (T) table.getPO(resultSet, trxName);
|
||||||
} else {
|
} else {
|
||||||
|
this.close(); // close it if there is no more data to read
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue