This commit is contained in:
Justin Bertram 2020-03-24 09:32:47 -05:00
commit 265c8f054d
2 changed files with 14 additions and 0 deletions

View File

@ -232,6 +232,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
holder = transactions.get(record.getTxId());
for (RecordInfo info : holder.recordsToDelete) {
deletedRecords.add(record.getId());
deletedRecords.add(info.id);
deleteJournalRecords.setLong(1, info.id);
deleteJournalRecords.addBatch();
}

View File

@ -178,6 +178,19 @@ public class JDBCJournalTest extends ActiveMQTestBase {
assertEquals(0, journal.getNumberOfRecords());
}
@Test
public void testCleanupTxRecords4TransactionalRecords() throws Exception {
// add committed transactional record e.g. paging
journal.appendAddRecordTransactional(152, 154, (byte) 13, new byte[0]);
journal.appendCommitRecord(152, true);
assertEquals(2, journal.getNumberOfRecords());
// delete transactional record in new transaction e.g. depaging
journal.appendDeleteRecordTransactional(236, 154);
journal.appendCommitRecord(236, true);
assertEquals(0, journal.getNumberOfRecords());
}
@Test
public void testCallbacks() throws Exception {
final int noRecords = 10;