protected DataTable[] ExecuteStatementBatch(IEnumerable <string> statements) { try { var results = new List <DataTable>(); using (var scope = this.BeginScope()) { scope.BeginTransaction(IsolationLevel.ReadCommitted); using (var command = scope.Connection.CreateCommand()) { command.CommandTimeout = 0; command.CommandType = CommandType.Text; if (scope.Transaction != null) { command.Transaction = scope.Transaction.DangerousInternalTransaction; } foreach (var statement in statements) { command.CommandText = statement; Log.Debug(Environment.NewLine + statement); try { using (var reader = new FirebirdCorrectingReader(command.ExecuteReader(CommandBehavior.Default))) { results.AddRange(reader.ToDataTables()); } } catch (Exception error) { throw new SoftwareException(error, "An error happened excuting statement: '{0}", statement); } } } scope.Commit(); } return(results.ToArray()); } catch (Exception error) { Log.Error(error.ToDiagnosticString()); throw; } }