final int threadNum = i+1;
threads[i] = new Thread(new Runnable() {
public void run() {
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
StackMaidDao dao = new StackMaidDaoImpl();
dao.pushCleanupDelegate(1L, 0, "delegate-" + threadNum, "Hello, world");
dao.pushCleanupDelegate(1L, 1, "delegate-" + threadNum, new Long(100));
dao.pushCleanupDelegate(1L, 2, "delegate-" + threadNum, null);
txn.close();
}
});
threads[i].start();
}
for(int i = 0; i < 3; i++) {
try {
threads[i].join();
} catch (InterruptedException e) {
}
}
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
StackMaidDao dao = new StackMaidDaoImpl();
List<CheckPointVO> l = dao.listLeftoversByMsid(1L);
for(CheckPointVO maid : l) {
s_logger.info("" + maid.getThreadId() + " " + maid.getDelegate() + " " + maid.getContext());
}
txn.close();