Inheritance: ITableSourceComposite
Ejemplo n.º 1
0
        internal TransactionWork(TableSourceComposite composite, Transaction transaction, IEnumerable<TableSource> selectedFromTables, IEnumerable<IMutableTable> touchedTables, TransactionRegistry journal)
        {
            Composite = composite;
            Transaction = transaction;
            SelectedFromTables = selectedFromTables;

            // Get individual journals for updates made to tables in this
            // transaction.
            // The list TableEventRegistry

            ChangedTables = touchedTables.Select(t => t.EventRegistry).Where(tableJournal => tableJournal.EventCount > 0);

            // The list of tables created by this journal.
            CreatedTables = journal.TablesCreated;
            // Ths list of tables dropped by this journal.
            DroppedTables = journal.TablesDropped;
            // The list of tables that constraints were alter by this journal
            ConstraintAlteredTables = journal.TablesConstraintAltered;

            // Get the list of all database objects that were created in the
            // transaction.
            ObjectsCreated = transaction.Registry.ObjectsCreated;
            // Get the list of all database objects that were dropped in the
            // transaction.
            ObjectsDropped = transaction.Registry.ObjectsDropped;

            CommitId = transaction.CommitId;
        }
Ejemplo n.º 2
0
        internal Database(DatabaseSystem system, IDatabaseContext context)
        {
            System  = system;
            Context = context;

            Name = Context.DatabaseName();

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(this);

            Context.RegisterInstance(this);
            Context.RegisterInstance <ITableSourceComposite>(TableComposite);

            Locker = new Locker(this);

            Sessions = new ActiveSessionList(this);

            // Create the single row table
            var t = new TemporaryTable(context, "SINGLE_ROW_TABLE", new ColumnInfo[0]);

            t.NewRow();
            SingleRowTable = t;

            TransactionFactory = new DatabaseTransactionFactory(this);
        }
Ejemplo n.º 3
0
        internal Database(DatabaseSystem system, IDatabaseContext context)
        {
            System = system;
            Context = context;

            Name = Context.DatabaseName();

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(this);

            Context.RegisterInstance(this);
            Context.RegisterInstance<ITableSourceComposite>(TableComposite);

            Locker = new Locker(this);

            Sessions = new ActiveSessionList(this);

            // Create the single row table
            var t = new TemporaryTable(context, "SINGLE_ROW_TABLE", new ColumnInfo[0]);
            t.NewRow();
            SingleRowTable = t;

            TransactionFactory = new DatabaseTransactionFactory(this);
        }
Ejemplo n.º 4
0
        internal TableManager(ITransaction transaction, TableSourceComposite composite)
        {
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            Transaction = transaction;

            Composite = composite;

            visibleTables = new List<TableSource>();
            tableIndices = new List<IIndexSet>();
            accessedTables = new List<IMutableTable>();
            tableCache = new Dictionary<ObjectName, IMutableTable>();
            selectedTables = new List<TableSource>();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Database"/> class providing
        /// a given parent <see cref="IDatabaseContext"/>.
        /// </summary>
        /// <param name="context">The database context that provides the required
        /// configurations and services to the database.</param>
        public Database(IDatabaseContext context)
        {
            DatabaseContext = context;

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(this);

            // Create the single row table
            var t = new TemporaryTable(context, "SINGLE_ROW_TABLE", new ColumnInfo[0]);
            t.NewRow();
            SingleRowTable = t;

            TransactionFactory = new DatabaseTransactionFactory(this);
        }
Ejemplo n.º 6
0
        private void Dispose(bool disposing)
        {
            if (!disposed) {
                if (disposing) {
                    if (IsOpen) {
                        // TODO: Report the error
                    }

                    if (Locker != null)
                        Locker.Reset();

                    if (TableComposite != null)
                        TableComposite.Dispose();

                    if (Context != null)
                        Context.Dispose();

                    if (System != null)
                        System.RemoveDatabase(this);
                }

                Locker = null;
                System = null;
                TableComposite = null;
                Context = null;
                disposed = true;
            }
        }
Ejemplo n.º 7
0
        private void Dispose(bool disposing)
        {
            if (disposing) {
                if (IsOpen) {
                    // TODO: Report the error
                }

                TableComposite.Dispose();
                DatabaseContext.Dispose();
            }

            TableComposite = null;
            DatabaseContext = null;
        }
Ejemplo n.º 8
0
        private void Dispose(bool disposing)
        {
            if (!disposed) {
                if (disposing) {
                    if (IsOpen) {
                        // TODO: Report the error
                    }

                    if (Locker != null)
                        Locker.Dispose();

                    if (TableComposite != null)
                        TableComposite.Dispose();

                    if (TransactionFactory != null &&
                        (TransactionFactory is IDisposable))
                        (TransactionFactory as IDisposable).Dispose();

                    if (Context != null)
                        Context.Dispose();

                    if (System != null)
                        System.RemoveDatabase(this);
                }

                TransactionFactory = null;
                Locker = null;
                System = null;
                TableComposite = null;
                Context = null;
                disposed = true;
            }
        }