private void Prepare() { Session.EnsureNotDisposed(); driver.EnsureConnectionIsOpen(Session, connection); foreach (var script in initializationSqlScripts) { using (var command = connection.CreateCommand(script)) { driver.ExecuteNonQuery(Session, command); } } initializationSqlScripts.Clear(); if (pendingTransaction == null) { return; } var transaction = pendingTransaction; pendingTransaction = null; if (connection.ActiveTransaction == null) { // Handle external transactions driver.BeginTransaction(Session, connection, IsolationLevelConverter.Convert(transaction.IsolationLevel)); } }
private void EnsureConnectionIsOpen() { driver.EnsureConnectionIsOpen(session, connection); }