/** Warning: this method has limited usability. See the UnsafeSingleThreaded class for * details */ public static Transaction beginUnsafeSingleThreaded() { Transaction parent = current.get(); if (parent != null) { throw new Error("Unsafe single-threaded transactions cannot be nested"); } ActiveTransactionsRecord activeRecord = getRecordForNewTransaction(); Transaction tx = new UnsafeSingleThreadedTransaction(activeRecord); tx.start(); return tx; }
public static Transaction beginInevitable() { Transaction parent = current.get(); if (parent != null) { throw new Error("Inevitable transactions cannot be nested"); } ActiveTransactionsRecord activeRecord = getRecordForNewTransaction(); Transaction tx = new InevitableTransaction(activeRecord); tx.start(); return tx; }
public static Transaction begin(boolean readOnly) { ActiveTransactionsRecord activeRecord = null; Transaction parent = current(); if (TRANSACTION_FACTORY.reuseTopLevelReadOnlyTransactions() && parent == null && readOnly) { Transaction tx = getRecordForNewTransaction().tx; tx.start(); return tx; } if (parent == null) { activeRecord = getRecordForNewTransaction(); } return beginWithActiveRecord(readOnly, activeRecord); }
protected void synchronizeJvstmState(int serverId) { ActiveTransactionsRecord activeRecord = Transaction.getRecordForNewTransaction(); Transaction tx = new InitTransaction(activeRecord); tx.start(); VBox<Integer> initBox = StandaloneVBox.makeNew("SERVER" + serverId, false); initBox.put(serverId); tx.commitTx(true); logger.info("Set the last committed TX number to {}", Transaction.mostRecentCommittedRecord.transactionNumber); }