Buggy code:
public Object command ( final OCommandRequestText iCommand ) { } public OStorageOperationResult < OPhysicalPosition > createRecord ( final ORecordId iRecordId , final byte [ ] iContent , final ORecordVersion iRecordVersion , final byte iRecordType , final int iMode , final ORecordCallback < Long > iCallback ) { } public OStorageOperationResult < ORawBuffer > readRecord ( final ORecordId iRecordId , final String iFetchPlan , final boolean iIgnoreCache , final ORecordCallback < ORawBuffer > iCallback , final boolean loadTombstones , LOCKING_STRATEGY iLockingStrategy ) { } @ Override public OStorageOperationResult < ORecordVersion > updateRecord ( final ORecordId iRecordId , final boolean updateContent , final byte [ ] iContent , final ORecordVersion iVersion , final byte iRecordType , final int iMode , final ORecordCallback < ORecordVersion > iCallback ) { } @ Override public OStorageOperationResult < Boolean > deleteRecord ( final ORecordId iRecordId , final ORecordVersion iVersion , final int iMode , final ORecordCallback < Boolean > iCallback ) { } @ Override public OStorageOperationResult < Boolean > hideRecord ( ORecordId recordId , int mode , ORecordCallback < Boolean > callback ) { } @ Override public ORecordMetadata getRecordMetadata ( ORID rid ) { } @ Override public boolean cleanOutRecord ( ORecordId recordId , ORecordVersion recordVersion , int iMode , ORecordCallback < Boolean > callback ) { } @ Override public boolean existsResource ( final String iName ) { } public OCluster getClusterByName ( final String iName ) { } @ Override public ORecordConflictStrategy getConflictStrategy ( ) { } @ Override public void setConflictStrategy ( final ORecordConflictStrategy iResolver ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > T removeResource ( final String iName ) { } @ Override public < T > T getResource ( final String iName , final Callable < T > iCallback ) { } @ Override public void open ( final String iUserName , final String iUserPassword , final Map < String , Object > iProperties ) { } @ Override public void create ( final Map < String , Object > iProperties ) { } @ Override public boolean exists ( ) { } @ Override public void reload ( ) { } @ Override public void delete ( ) { } @ Override public void close ( ) { } @ Override public void close ( final boolean iForce , boolean onDelete ) { } @ Override public boolean isClosed ( ) { } @ Override public void commit ( final OTransaction iTx , final Runnable callback ) { if ( ( INSTANCE . get ( ) ) == ( RUN_MODE . RUNNING_DISTRIBUTED ) ) { wrapped . commit ( iTx , callback ) ; return ; } final ODistributedConfiguration dbCfg = dManager . getDatabaseConfiguration ( getName ( ) ) ; final String localNodeName = dManager . getLocalNodeName ( ) ; checkNodeIsMaster ( localNodeName , dbCfg ) ; try { if ( ! ( dbCfg . isReplicationActive ( null , localNodeName ) ) ) { ODistributedAbstractPlugin . runInDistributedMode ( new Callable ( ) { @ Override public Object call ( ) throws Exception { wrapped . commit ( iTx , callback ) ; return null ; } } ) ; return ; } OTransactionInternal . setStatus ( ( ( OTransactionAbstract ) ( iTx ) ) , BEGUN ) ; final OTxTask txTask = new OTxTask ( ) ; final Set < String > involvedClusters = new HashSet < String > ( ) ; final List < ORecordOperation > tmpEntries = new ArrayList < ORecordOperation > ( ) ; while ( iTx . getCurrentRecordEntries ( ) . iterator ( ) . hasNext ( ) ) { for ( ORecordOperation txEntry : iTx . getCurrentRecordEntries ( ) ) tmpEntries . add ( txEntry ) ; iTx . clearRecordEntries ( ) ; for ( ORecordOperation op : tmpEntries ) { final OAbstractRecordReplicatedTask task ; final ORecord record = op . getRecord ( ) ; final ORecordId rid = ( ( ORecordId ) ( record . getIdentity ( ) ) ) ; switch ( op . type ) { case ORecordOperation . CREATED : if ( rid . isNew ( ) ) { <START_BUG> task = new OCreateRecordTask ( record ) ; <END_BUG> if ( record instanceof ODocument ) ( ( ODocument ) ( record ) ) . validate ( ) ; break ; } case ORecordOperation . UPDATED : if ( record instanceof ODocument ) ( ( ODocument ) ( record ) ) . validate ( ) ; final OStorageOperationResult < ORawBuffer > previousContent = wrapped . readRecord ( rid , null , false , null , false , DEFAULT ) ; if ( ( previousContent . getResult ( ) ) == null ) throw new OTransactionException ( ( ( "Cannot<seq2seq4repair_space>update<seq2seq4repair_space>record<seq2seq4repair_space>'" + rid ) + "'<seq2seq4repair_space>because<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>deleted" ) ) ; task = new OUpdateRecordTask ( rid , previousContent . getResult ( ) . getBuffer ( ) , previousContent . getResult ( ) . version , record . toStream ( ) , record . getRecordVersion ( ) , ORecordInternal . getRecordType ( record ) ) ; break ; case ORecordOperation . DELETED : task = new ODeleteRecordTask ( rid , record . getRecordVersion ( ) ) ; break ; default : continue ; } involvedClusters . add ( getClusterNameByRID ( rid ) ) ; txTask . add ( task ) ; } } OTransactionInternal . setStatus ( ( ( OTransactionAbstract ) ( iTx ) ) , COMMITTING ) ; final Set < String > nodes = dbCfg . getServers ( involvedClusters ) ; Boolean executionModeSynch = dbCfg . isExecutionModeSynchronous ( null ) ; if ( executionModeSynch == null ) executionModeSynch = Boolean . TRUE ; if ( executionModeSynch ) { final Object result = dManager . sendRequest ( getName ( ) , involvedClusters , nodes , txTask , RESPONSE ) ; if ( result instanceof List < ? > ) { final List < Object > list = ( ( List < Object > ) ( result ) ) ;

Fix:
task = new OCreateRecordTask ( record . copy ( ) ) ;