MessageProducer p = s.createProducer(new ActiveMQQueue("Tx"));
p.send(s.createTextMessage("aa"));
// kill journal without commit
KahaDBPersistenceAdapter pa = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
KahaDBStore store = pa.getStore();
assertNotNull("last tx location is present " + store.getInProgressTxLocationRange()[1]);
// test hack, close the journal to ensure no further journal updates when broker stops
// mimic kill -9 in terms of no normal shutdown sequence
store.getJournal().close();
try {
store.close();
} catch (Exception expectedLotsAsJournalBorked) {
}
broker.stop();
broker.waitUntilStopped();
// restart with recovery
broker = createAndStartBroker(false);
pa = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
store = pa.getStore();
// inflight non xa tx should be rolledback on recovery
assertNull("in progress tx location is present ", store.getInProgressTxLocationRange()[0]);
}