Nick,

Many thanks for the input. After a lot of head-scratching it seems that
Derby 10.3.2.1 (the *latest* version) gets fuddled with the SQL
statement
in the Recovery Log consistency check. The join below returns rows that
*do* have a 'commit' for the transaction!!

      // Look for open transactions
      stmt = getDatabaseConnection().prepareStatement(
          "SELECT * FROM " + getLogTableName() + " WHERE "
              + getLogTableSqlColumnName() + " LIKE ? AND "
              + "transaction_id not in (SELECT transaction_id" + " FROM
"
              + getLogTableName() + " WHERE " +
getLogTableSqlColumnName()
              + " = ? OR " + getLogTableSqlColumnName() + " = ?) ");

      stmt.setString(1, BEGIN + "%");
      stmt.setString(2, COMMIT);
      stmt.setString(3, ROLLBACK);
Looks to me that the String comparison should alway use LIKE, most databases 
have different ways to interpret '=' on Strings.
What happens if you replace the query by:
stmt = getDatabaseConnection().prepareStatement(
         "SELECT * FROM " + getLogTableName() + " WHERE "
             + getLogTableSqlColumnName() + " LIKE ? AND "
             + "transaction_id not in (SELECT transaction_id" + " FROM
"
             + getLogTableName() + " WHERE " +
getLogTableSqlColumnName()
             + " LIKE ? OR " + getLogTableSqlColumnName() + " LIKE ?) ");


Thanks for your feedback,
Emmanuel
--
Emmanuel Cecchet - Research scientist
EPFL - LABOS/DSLAB - IN.N 317
Phone: +41-21-693-7558

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to