public void apply( Transaction transaction ) throws TransactionFailureException { TransactionRepresentation representation = transaction.representation( idGenerator(), masterId(), myId(), transactionIdStore.getLastCommittedTransactionId(), neoStores ); commitProcess.commit( new TransactionToApply( representation ), CommitEvent.NULL, TransactionApplicationMode.EXTERNAL ); }
public void appendToLogAndApplyToStore( CommittedTransactionRepresentation tx ) throws TransactionFailureException { commitProcess.commit( new TransactionToApply( tx.getTransactionRepresentation(), tx.getCommitEntry().getTxId() ), NULL, EXTERNAL ); } }
public void appendToLogAndApplyToStore( CommittedTransactionRepresentation tx ) throws TransactionFailureException { commitProcess.commit( new TransactionToApply( tx.getTransactionRepresentation(), tx.getCommitEntry().getTxId(), versionContextSupplier.getVersionContext() ), NULL, EXTERNAL ); } }
@SuppressWarnings("deprecation") protected void applyTransaction( Transaction transaction ) throws TransactionFailureException { // TODO you know... we could have just appended the transaction representation to the log // and the next startup of the store would do recovery where the transaction would have been // applied and all would have been well. GraphDatabaseBuilder builder = new TestGraphDatabaseFactory().newEmbeddedDatabaseBuilder( directory ); GraphDatabaseAPI database = (GraphDatabaseAPI) builder.newGraphDatabase(); try ( LockGroup locks = new LockGroup() ) { DependencyResolver dependencyResolver = database.getDependencyResolver(); TransactionRepresentationCommitProcess commitProcess = new TransactionRepresentationCommitProcess( dependencyResolver.resolveDependency( TransactionAppender.class ), dependencyResolver.resolveDependency( TransactionRepresentationStoreApplier.class ), dependencyResolver.resolveDependency( IndexUpdatesValidator.class ) ); TransactionIdStore transactionIdStore = database.getDependencyResolver().resolveDependency( TransactionIdStore.class ); NodeStore nodes = database.getDependencyResolver().resolveDependency( NeoStores.class ).getNodeStore(); commitProcess.commit( transaction.representation( idGenerator(), masterId(), myId(), transactionIdStore.getLastCommittedTransactionId(), nodes ), locks, CommitEvent.NULL, TransactionApplicationMode.EXTERNAL ); } finally { database.shutdown(); } }