if (txEntry.status != OTransactionEntry.DELETED && !txEntry.getRecord().isDirty())
return;
final ORecordId rid = (ORecordId) txEntry.getRecord().getIdentity();
final OCluster cluster = txEntry.clusterName != null ? storage.getClusterByName(txEntry.clusterName) : storage
.getClusterById(rid.clusterId);
if (!(cluster instanceof OClusterLocal))
// ONLY LOCAL CLUSTER ARE INVOLVED IN TX
return;
if (txEntry.getRecord() instanceof OTxListener)
((OTxListener) txEntry.getRecord()).onEvent(txEntry, OTxListener.EVENT.BEFORE_COMMIT);
switch (txEntry.status) {
case OTransactionEntry.LOADED:
break;
case OTransactionEntry.CREATED: {
// CHECK 2 TIMES TO ASSURE THAT IT'S A CREATE OR AN UPDATE BASED ON RECURSIVE TO-STREAM METHOD
byte[] stream = txEntry.getRecord().toStream();
if (rid.isNew()) {
if (iTx.getDatabase().callbackHooks(ORecordHook.TYPE.BEFORE_CREATE, txEntry.getRecord()))
// RECORD CHANGED: RE-STREAM IT
stream = txEntry.getRecord().toStream();
rid.clusterId = cluster.getId();
if (iUseLog)
createRecord(iTx.getId(), cluster, rid, stream, txEntry.getRecord().getRecordType());
else
iTx.getDatabase().getStorage().createRecord(rid, stream, txEntry.getRecord().getRecordType());