I have the following code:
try (DB db = new DB()) {
db.open(cpds);
// Using the metadata to walk down the tree and identify all
// children nodes to the leaf tables.
// First the metadata for the pk of the target table
List<Integer> recordIdList = new ArrayList<Integer>();
recordIdList.add(recordId);
batchInsertDeletePks(recordIdList, db);
List<Integer> pkValues = new ArrayList<Integer>();
pkValues.add(recordId);
prepareChildDeletes(tablemeta_id, pkValues, recordId, db);
ColumnData.delete("RECORD_ID IN (SELECT ID FROM TEMPDELETE)");
noDeleted = RecordData.delete("ID IN (SELECT ID FROM TEMPDELETE)");
TempDelete.deleteAll();
} catch (Exception ex) {
logger.debug(ex.getMessage());
}
The TEMPDELETE has all of the primary keys I need to delete from COLUMNDATA. The ColumnData.delete is not working, the RecordData.delete is not working and the TempDelete.deleteAll is not working. They give no exceptions. The database is h2-1.4.196
If I debug trace into them and cut and paste the SQL that is created and run that SQL in a sql interpreter all the queries work just fine.
I cannot see what it is about my approach that is different to the examples? Any ideas?