/// <summary> /// Starts a transaction. The resulting transaction handle can be used to chain operations together. /// </summary> /// <param name="isolationLevel">Isolation level of the operations executed in the transaction.</param> /// <returns></returns> public override ITransaction BeginTransaction(System.Data.IsolationLevel isolationLevel) { if (_stardogTransaction != null) { throw new ApplicationException("Only one transaction is supported at a time. Dispose and rollback changes or use the open transaction."); } _stardogTransaction = new StardogTransaction(_connector); _stardogTransaction.OnFinishedTransaction += OnTransactionCompleted; return(_stardogTransaction); }
/// <summary> /// Invoked when a transaction is completed. /// </summary> /// <param name="sender">Object which invoked the event.</param> /// <param name="e">Event arguments.</param> protected void OnTransactionCompleted(object sender, TransactionEventArgs e) { _stardogTransaction = null; }