internal async Task InitializeAsync() { IndexCommand.ResetQueryCache(); Indexes = new List <IIndexProvider>(); ScopedIndexes = new List <Type>(); ValidateConfiguration(); _sessionPool = new ObjectPool <Session>(MakeSession, Configuration.SessionPoolSize); Dialect = SqlDialectFactory.For(Configuration.ConnectionFactory.DbConnectionType); TypeNames = new TypeService(); using (var connection = Configuration.ConnectionFactory.CreateConnection()) { await connection.OpenAsync(); using (var transaction = connection.BeginTransaction(Configuration.IsolationLevel)) { var builder = new SchemaBuilder(Configuration, transaction); await Configuration.IdGenerator.InitializeAsync(this, builder); transaction.Commit(); } } // Pre-initialize the default collection await InitializeCollectionAsync(""); }
internal async Task InitializeAsync() { IndexCommand.ResetQueryCache(); Indexes = new List <IIndexProvider>(); ScopedIndexes = new List <Type>(); ValidateConfiguration(); _sessionPool = new ObjectPool <Session>(MakeSession, Configuration.SessionPoolSize); Dialect = SqlDialectFactory.For(Configuration.ConnectionFactory.DbConnectionType); TypeNames = new TypeService(); using (var connection = Configuration.ConnectionFactory.CreateConnection()) { await connection.OpenAsync(); using (var transaction = connection.BeginTransaction()) { var builder = new SchemaBuilder(Configuration, transaction); await Configuration.IdGenerator.InitializeAsync(this, builder); transaction.Commit(); } //)FIXME : in Oracle it's forbidden to index an already indexed column and PK/UK is already indexed //.AlterTable(LinearBlockIdGenerator.TableName, table => table // .CreateIndex("IX_Dimension", "dimension") } // Pee-initialize the default collection await InitializeCollectionAsync(Dialect.NullString); }
public void AfterConfigurationAssigned() { IndexCommand.ResetQueryCache(); Indexes = new List <IIndexProvider>(); ValidateConfiguration(); IdGenerator = new LinearBlockIdGenerator(Configuration.ConnectionFactory, 20, Configuration.TablePrefix); }
public Store(Configuration configuration) { IndexCommand.ResetQueryCache(); Configuration = configuration; Indexes = new List <IIndexProvider>(); ValidateConfiguration(); IdGenerator = new LinearBlockIdGenerator(Configuration.ConnectionFactory, 20, Configuration.TablePrefix); }
public void AfterConfigurationAssigned() { IndexCommand.ResetQueryCache(); Indexes = new List <IIndexProvider>(); ValidateConfiguration(); IdGenerator = new LinearBlockIdGenerator(Configuration.ConnectionFactory, Configuration.LinearBlockSize, Configuration.TablePrefix); _sessionPool = new ObjectPool <Session>(MakeSession, Configuration.SessionPoolSize); }
public async Task InitializeAsync() { IndexCommand.ResetQueryCache(); ValidateConfiguration(); _sessionPool = new ObjectPool <Session>(MakeSession, Configuration.SessionPoolSize); TypeNames = new TypeService(); #if SUPPORTS_ASYNC_TRANSACTIONS await using (var connection = Configuration.ConnectionFactory.CreateConnection()) { await connection.OpenAsync(); await using (var transaction = connection.BeginTransaction(Configuration.IsolationLevel)) #else using (var connection = Configuration.ConnectionFactory.CreateConnection()) { await connection.OpenAsync(); using (var transaction = connection.BeginTransaction(Configuration.IsolationLevel)) #endif { var builder = new SchemaBuilder(Configuration, transaction); await Configuration.IdGenerator.InitializeAsync(this, builder); #if SUPPORTS_ASYNC_TRANSACTIONS await transaction.CommitAsync(); #else transaction.Commit(); #endif } } // Pre-initialize the default collection await InitializeCollectionAsync(""); }