Ejemplo n.º 1
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.º 2
0
        public DatabaseContext(ISystemContext systemContext, IConfiguration configuration)
        {
            if (systemContext == null)
                throw new ArgumentNullException("systemContext");
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            SystemContext = systemContext;
            SystemContext.ServiceProvider.AttachContext(this);

            Configuration = configuration;
            Locker = new Locker(this);

            Sessions = new ActiveSessionList(this);

            Init();
        }