예제 #1
0
        public override void Dispose()
        {
            Store?.Dispose();
            StateStore?.Dispose();

            if (!(Path is null))
            {
                Directory.Delete(Path, true);
            }
        }
        //public ITransaction CreateTransaction(TransactionIsolation isolation) {
        //	var thisCommittedTables = new List<TableSource>();

        //	// Don't let a commit happen while we are looking at this.
        //	lock (commitLock) {
        //		long 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 the transaction and record it in the open transactions list.
        //		var t = new Transaction(this, thisCommitId, isolation, thisCommittedTables, indexInfo);
        //		openTransactions.AddTransaction(t);
        //		return t;
        //	}

        //}

        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!IsClosed)
                {
                    Close();
                }

                if (lobStore != null)
                {
                    lobStore.Dispose();
                }
                if (stateStore != null)
                {
                    stateStore.Dispose();
                }

                if (tableSources != null)
                {
                    foreach (var tableSource in tableSources)
                    {
                        tableSource.Value.Dispose();
                    }

                    tableSources.Clear();
                }

                if (StateStore != null)
                {
                    StateStore.Dispose();
                }

                if (LargeObjectStore != null)
                {
                    LargeObjectStore.Dispose();
                }

                if (tempStoreSystem != null)
                {
                    tempStoreSystem.Dispose();
                }
            }

            tableSources    = null;
            StateStore      = null;
            tempStoreSystem = null;
            lobStore        = null;
            Database        = null;
        }
예제 #3
0
 public override void Dispose()
 {
     Store?.Dispose();
     StateStore?.Dispose();
 }