CreateTransactionContext() public method

Creates a new context to be provided to a Transaction instance that is handled by the parent database.
public CreateTransactionContext ( ) : TransactionContext
return Deveel.Data.Transactions.TransactionContext
        internal ITransaction CreateTransaction(IsolationLevel isolation)
        {
            var thisCommittedTables = new List <TableSource>();

            // Don't let a commit happen while we are looking at this.
            lock (commitLock) {
                int thisCommitId       = CurrentCommitId;
                var committedTableList = StateStore.GetVisibleList();
                thisCommittedTables.AddRange(committedTableList.Select(resource => GetTableSource(resource.TableId)));

                // Create a set of IIndexSet for all the tables in this transaction.
                var indexInfo = (thisCommittedTables.Select(mtable => mtable.CreateIndexSet())).ToList();

                // Create a context for the transaction to handle the isolated storage of variables and services
                var context = DatabaseContext.CreateTransactionContext();

                // Create the transaction and record it in the open transactions list.
                return(new Transaction(context, Database, thisCommitId, isolation, thisCommittedTables, indexInfo));
            }
        }