Esempio n. 1
0
        private ITableSystem DiscoverTableSystem()
        {
            if (tableSystem == null)
            {
                var typeString = this.TableSystemTypeName();

                if (String.IsNullOrEmpty(typeString))
                {
                    tableSystem = Scope.Resolve <ITableSystem>();
                }
                else
                {
                    var type = Type.GetType(typeString, false);
                    if (type == null || !typeof(ITableSystem).IsAssignableFrom(type))
                    {
                        throw new InvalidOperationException($"Type '{typeString}' is not valid for a table system");
                    }

                    tableSystem = Scope.Resolve(type) as ITableSystem;
                    Scope.AsContainer().RegisterInstance <ITableSystem>(tableSystem);
                }
            }

            return(tableSystem);
        }
Esempio n. 2
0
        public TableManager(ITransaction transaction, ITableSystem tableSystem)
        {
            Transaction = transaction ?? throw new ArgumentNullException(nameof(transaction));
            TableSystem = tableSystem ?? throw new ArgumentNullException(nameof(tableSystem));

            tableContainers = transaction.GetServices <ITableContainer>().ToList();

            tableCache = new Dictionary <ObjectName, IMutableTable>();
        }
Esempio n. 3
0
        internal Transaction(IDatabase database, ITableSystem tableSystem, long commitId, ITableSource[] visibleTables, IRowIndexSet[] indexSets)
            : base(database, KnownScopes.Transaction)
        {
            Database    = database;
            TableSystem = tableSystem;
            CommitId    = commitId;

            Configuration = new Configuration();

            if (database.Configuration != null)
            {
                Configuration = Configuration.MergeWith(database.Configuration);
            }

            Scope.AsContainer().RegisterInstance <ITransaction>(this);

            TableManager = this.GetTableManager();
            Registry     = new TransactionEventRegistry();

            State = new TransactionState(visibleTables, indexSets);
            State.AddVisibleTables(visibleTables, indexSets);

            Status = TransactionStatus.Started;
        }