private void SetupSystem() { using (var transaction = Database.CreateSafeTransaction(IsolationLevel.Serializable)) { try { using (var session = new SystemSession(transaction, SystemSchema.Name)) { using (var query = session.CreateQuery()) { foreach (var feature in Database.System.Features) { try { feature.OnSystemEvent(SystemEventType.TableCompositeSetup, query); } catch (Exception ex) { query.Context.OnError( new Exception( String.Format("The feature {0} (v{1}) caused an error on Composite-Setup event.", feature.FeatureName, feature.Version), ex)); throw; } } } } // Commit and close the transaction. transaction.Commit(); } catch (TransactionException e) { throw new InvalidOperationException("Transaction Exception initializing the system.", e); } } }
private void InitSystemSchema() { using (var transaction = Database.CreateSafeTransaction(IsolationLevel.Serializable)) { try { SystemSchema.Setup(transaction); transaction.Commit(); } catch (Exception ex) { throw new InvalidOperationException("Transaction Exception initializing tables.", ex); } } }
private void CreateSystem() { // Create the transaction using (var transaction = Database.CreateSafeTransaction(IsolationLevel.Serializable)) { try { using (var session = new SystemSession(transaction, SystemSchema.Name)) { using (var query = session.CreateQuery()) { foreach (var feature in Database.System.Features) { feature.OnSystemEvent(SystemEventType.TableCompositeCreate, query); } } } // Commit and close the transaction. transaction.Commit(); } catch (TransactionException e) { throw new InvalidOperationException("Transaction Exception creating composite.", e); } } }
private void CreateSystemSchema() { // Create the transaction ITransaction transaction = null; try { transaction = Database.CreateSafeTransaction(IsolationLevel.Serializable); transaction.CreateSystemSchema(); // Commit and close the transaction. transaction.Commit(); transaction = null; } catch (TransactionException e) { throw new InvalidOperationException("Transaction Exception creating composite.", e); } finally { if (transaction != null) { transaction.Rollback(); } } }