Closing the resultSet and the statement was missing in the updateFromTxLogsOnDatabase method of TransactionChangeLogs class
Can one please review and fix the trunk?
Thanks!
Stephane
Line Added
Line modified (I've removed the commented part)
public static ActiveTransactionsRecord updateFromTxLogsOnDatabase(PersistenceBroker pb,
ActiveTransactionsRecord record,
boolean forUpdate)
throws SQLException,LookupException {
Connection conn = pb.serviceConnectionManager().getConnection();
// ensure that the connection is up-to-date
conn.commit();
Statement stmt = null;
ResultSet rs = null;
try {
/*Statement*/ stmt = conn.createStatement();
// read tx logs
int maxTxNumber = record.transactionNumber;
/*ResultSet*/ rs = stmt.executeQuery("SELECT OBJ_OID,OBJ_ATTR,TX_NUMBER FROM FF$TX_CHANGE_LOGS WHERE TX_NUMBER > "
+ (forUpdate ? (maxTxNumber - 1) : maxTxNumber)
+ " ORDER BY TX_NUMBER"
+ (forUpdate ? " FOR UPDATE" : ""));
// if there are any results to be processed, process them
if (rs.next()) {
return processAlienTransaction(pb, rs, record);
} else {
return record;
}
} finally {
if (rs != null) {
rs.close();
}
if (stmt != null) {
stmt.close();