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));
            }
        }
示例#2
0
 private void EnsureConnectionIsOpen()
 {
     driver.EnsureConnectionIsOpen(session, connection);
 }