use of com.orientechnologies.orient.core.tx.OTransactionAbstract in project orientdb by orientechnologies.
the class ODistributedTransactionManager method checkForClusterIds.
protected void checkForClusterIds(final OTransaction iTx, final String localNodeName, final ODistributedConfiguration dbCfg) {
for (ORecordOperation op : iTx.getAllRecordEntries()) {
final ORecordId rid = (ORecordId) op.getRecord().getIdentity();
switch(op.type) {
case ORecordOperation.CREATED:
final ORecordId newRid = rid.copy();
if (rid.getClusterId() < 1) {
final String clusterName = ((OTransactionAbstract) iTx).getClusterName(op.getRecord());
if (clusterName != null) {
newRid.setClusterId(ODatabaseRecordThreadLocal.INSTANCE.get().getClusterIdByName(clusterName));
iTx.updateIdentityAfterCommit(rid, newRid);
}
}
if (storage.checkForCluster(op.getRecord(), localNodeName, dbCfg) != null)
iTx.updateIdentityAfterCommit(rid, newRid);
break;
}
}
}
Aggregations