18 using System.Collections.Generic;
23 namespace Deveel.Data.Transactions {
29 if (tableName == null)
30 throw new ArgumentNullException(
"tableName");
32 TableName = tableName;
34 addedList =
new List<int>();
35 removedList =
new List<int>();
40 protected bool IsInTransaction {
get;
private set; }
43 IsInTransaction =
true;
48 IsInTransaction =
false;
56 ((ICallbackHandler)transaction).OnCallbackAttached(
this);
63 ((ICallbackHandler)transaction).OnCallbackDetached(
this);
67 IList<int> add,
remove;
69 add =
new List<int>(addedList);
70 remove =
new List<int>(removedList);
76 OnAction(add,
remove);
80 if (TableName.Equals(commitInfo.
TableName)) {
86 protected abstract void OnAction(IEnumerable<int> addedRows, IEnumerable<int> removedRows);
IEnumerable< int > AddedRows
void DetachFrom(ITransaction transaction)
void UnregisterOnCommit(Action< TableCommitInfo > action)
Describes the name of an object within a database.
IEnumerable< int > RemovedRows
void OnTransactionStarted()
readonly List< int > removedList
TableCommitCallback(ObjectName tableName)
readonly List< int > addedList
void RegisterOnCommit(Action< TableCommitInfo > action)
void OnCommit(TableCommitInfo commitInfo)
void AttachTo(ITransaction transaction)
The simplest implementation of a transaction.