private void prepareForCommit() { for ( Command.NodeCommand command : nodeCommands ) { neoStores.getNodeStore().prepareForCommit( command.getAfter() ); } for ( Command.RelationshipCommand command : relationshipCommands ) { neoStores.getRelationshipStore().prepareForCommit( command.getAfter() ); } for ( Command.RelationshipGroupCommand command : relationshipGroupCommands ) { neoStores.getRelationshipGroupStore().prepareForCommit( command.getAfter() ); } }
private Sabotage sabotage( RelationshipStore store, long id ) { RelationshipRecord before = store.getRecord( id, store.newRecord(), RecordLoad.NORMAL ); RelationshipRecord after = before.clone(); long otherReference; if ( !after.isFirstInFirstChain() ) { after.setFirstPrevRel( otherReference = after.getFirstPrevRel() + 1 ); } else { after.setFirstNextRel( otherReference = after.getFirstNextRel() + 1 ); } store.prepareForCommit( after ); store.updateRecord( after ); RelationshipRecord other = store.getRecord( otherReference, store.newRecord(), RecordLoad.FORCE ); return new Sabotage( before, after, other ); } }
relationshipRecord.setFirstPrevRel( Record.NO_NEXT_RELATIONSHIP.intValue() ); relationshipRecord.setSecondPrevRel( Record.NO_NEXT_RELATIONSHIP.intValue() ); relationshipStore.prepareForCommit( relationshipRecord, prepareIdSequence.apply( relationshipRecord.getId() ) ); relationshipStore.updateRecord( relationshipRecord ); relationshipCount++;
relationshipRecord.setFirstPrevRel( Record.NO_NEXT_RELATIONSHIP.intValue() ); relationshipRecord.setSecondPrevRel( Record.NO_NEXT_RELATIONSHIP.intValue() ); relationshipStore.prepareForCommit( relationshipRecord, prepareIdSequence.apply( relationshipRecord.getId() ) ); relationshipStore.updateRecord( relationshipRecord ); relationshipCount++;