public TransactionContext(long txID, int k) { mTxID = txID; mTansactionState = TransactionStates.UNDEFINED; mKeyValues = new ConcurrentDictionary<string, List<Pair<string, long>>>(); mTimeStamp = DateTime.Now.Ticks; mStillActive = false; K = k; }
public TransactionContext() { mTxID = DateTime.Now.Ticks; mValuesOfKey = new Dictionary<string, List<string>>(); mTansactionState = TransactionStates.UNDEFINED; mKeyToServer = new Dictionary<string, string>(); oldRegVals = new List<string>(); mStillActive = false; }
public TransactionContext(long txID, int k) { mTxID = txID; mTansactionState = TransactionStates.UNDEFINED; mKeyValues = new ConcurrentDictionary <string, List <Pair <string, long> > >(); mTimeStamp = DateTime.Now.Ticks; mStillActive = false; K = k; }
public TransactionContext() { mTxID = DateTime.Now.Ticks; mValuesOfKey = new Dictionary <string, List <string> >(); mTansactionState = TransactionStates.UNDEFINED; mKeyToServer = new Dictionary <string, string>(); oldRegVals = new List <string>(); mStillActive = false; }
/// <summary> /// Sets the state of a transaction /// </summary> /// <param name="txID"></param> /// <param name="state"></param> public void setTransactionState(long txID, TransactionStates state) { TransactionContext tx; if (mTransactions.TryGetValue(txID, out tx)) { tx.TransactionState = state; } else { throw new RemoteException("Could not get transaction with id: " + txID); } }
/// <summary> /// Sets the state of a transaction /// </summary> /// <param name="txID"></param> /// <param name="state"></param> public void setTransactionState(long txID, TransactionStates state) { TransactionContext tx; if (mTransactions.TryGetValue(txID, out tx)) { tx.TransactionState = state; } else { throw new RemoteException("Could not get transaction with id: " + txID); } }
public static TransferEvent CreateNew(string clientId, string clientMultiSig, string fromId, string assetId, double amount, string transactionId, string addressFrom, string addressTo, bool isHidden = false, TransactionStates state = TransactionStates.InProcessOffchain) { return(new TransferEvent { Id = Guid.NewGuid().ToString("N"), ClientId = clientId, DateTime = DateTime.UtcNow, FromId = fromId, AssetId = assetId, Amount = amount, TransactionId = transactionId, IsHidden = isHidden, AddressFrom = addressFrom, AddressTo = addressTo, Multisig = clientMultiSig, IsSettled = false, State = state }); }
//-------------------------------------------------- public void EndTransaction() { m_trans_state = TransactionStates.Ended; cmd.Transaction = null; }
//---------------------------------------------- public Boolean RollBack() { //'If (m_trans_state = TransactionStates.Running) Then //' m_transaction.Rollback() //' m_trans_state = TransactionStates.RollBacked //' cmd.Transaction = Nothing //' Return True //'Else //' Throw New Exception("No transaction is in progress.Begin a transaction first to Rollback it.") //'End If //'Return False if (cmd.Transaction != null) { m_transaction.Rollback(); m_trans_state = TransactionStates.RollBacked; cmd.Transaction = null; return true; } else throw new Exception("No transaction is in progress.Begin a transaction first to Rollback it."); }
//--------------------------------------------- public Boolean Commit() { if (m_trans_state != TransactionStates.UnInit) { m_transaction.Commit(); m_trans_state = TransactionStates.Committed; //'cmd.Transaction = Nothing return true; } else { throw new Exception("No transaction is in progress.Begin a transaction first to commit it."); } //return false; }
//--------------------------------------- public Boolean BeginTransaction() { if (m_trans_state != TransactionStates.Running) { m_transaction = conn.BeginTransaction(); cmd.Transaction = m_transaction; m_trans_state = TransactionStates.Running; return true; } else { throw new Exception("Cannot begin multiple transactions.ie Another transaction already in progress"); } //return false; }