Cursor cursor = null;
try
{
cursor = getXidDb().openCursor(null, null);
DatabaseEntry key = new DatabaseEntry();
XidBinding keyBinding = XidBinding.getInstance();
PreparedTransactionBinding valueBinding = new PreparedTransactionBinding();
DatabaseEntry value = new DatabaseEntry();
while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
{
Xid xid = keyBinding.entryToObject(key);
PreparedTransaction preparedTransaction = valueBinding.entryToObject(value);
if (!handler.handle(xid.getFormat(), xid.getGlobalId(), xid.getBranchId(),
preparedTransaction.getEnqueues(), preparedTransaction.getDequeues()))
{
break;