/** The stage in a commit after committing - make the changes permanent in the base data */ private void enactTransaction(Transaction transaction) { transaction.forAllComponents(x->x.enactCommitted(transaction)); transaction.forAllComponents(x->x.clearupCommitted(transaction)); transaction.signalEnacted() ; }
private void prepare() { state = TxnState.PREPARING ; forAllComponents(x->x.commitPrepare(this)); }
private void committed() { forAllComponents(x->x.committed(this)); }
throw new TDBTransactionException("Transaction has already committed or aborted") ; try { forAllComponents(x->x.abort(this)) ;
synchronized private DatasetGraphTxn begin$(TxnType txnType, TxnType originalTxnType, String label) { Objects.requireNonNull(txnType); if ( txnType == TxnType.WRITE && activeWriters.get() > 0 ) // Guard throw new TDBTransactionException("Existing active write transaction") ; if ( DEBUG ) switch ( txnType ) { case READ : System.out.print("r") ; break ; case WRITE : System.out.print("w") ; break ; case READ_COMMITTED_PROMOTE : System.out.print("r(cp)") ; break ; case READ_PROMOTE : System.out.print("rp") ; break ; } DatasetGraphTDB dsg = determineBaseDataset() ; Transaction txn = createTransaction(dsg, txnType, originalTxnType, label) ; log("begin$", txn) ; ReadWrite mode = initialMode(txnType); DatasetGraphTxn dsgTxn = createDSGTxn(dsg, txn, mode); txn.setActiveDataset(dsgTxn) ; dsgTxn.getTransaction().forAllComponents(component->component.begin(dsgTxn.getTransaction())) ; return dsgTxn ; }