final Set<String> involvedClusters = new HashSet<String>();
for (ORecordOperation op : iTx.getCurrentRecordEntries()) {
final OAbstractRecordReplicatedTask task;
final ORecord record = op.getRecord();
final ORecordId rid = (ORecordId) op.record.getIdentity();
switch (op.type) {
case ORecordOperation.CREATED:
task = new OCreateRecordTask(rid, record.toStream(), record.getRecordVersion(), ORecordInternal.getRecordType(record));
break;
case ORecordOperation.UPDATED:
// LOAD PREVIOUS CONTENT TO BE USED IN CASE OF UNDO
final OStorageOperationResult<ORawBuffer> previousContent = wrapped.readRecord(rid, null, false, null, false,
LOCKING_STRATEGY.DEFAULT);
if (previousContent.getResult() == null)
// DELETED
throw new OTransactionException("Cannot update record '" + rid + "' because has been deleted");
task = new OUpdateRecordTask(rid, previousContent.getResult().getBuffer(), previousContent.getResult().version,
record.toStream(), record.getRecordVersion());
break;
case ORecordOperation.DELETED:
task = new ODeleteRecordTask(rid, record.getRecordVersion());
break;
default:
continue;
}