Business intelligence made simple
Fix issue with transactions
Andrew467690f79edb
diff --git a/lib/blazer/data_source.rb b/lib/blazer/data_source.rbindex f8ca46f5..b49f7a85 100644--- a/lib/blazer/data_source.rb+++ b/lib/blazer/data_source.rb@@ -37,8 +37,8 @@ module Blazerdef run_statement(statement, options = {})rows = []error = nil- begin- connection_model.transaction do+ connection_model.transaction do+ beginconnection_model.connection.execute("SET statement_timeout = #{timeout.to_i * 1000}") if timeout && postgresql?comment = "blazer"if options[:user].respond_to?(:id)@@ -55,10 +55,11 @@ module Blazerendrows << rowend+ rescue ActiveRecord::StatementInvalid => e+ error = e.message.sub(/.+ERROR: /, "")+ ensureraise ActiveRecord::Rollbackend- rescue ActiveRecord::StatementInvalid => e- error = e.message.sub(/.+ERROR: /, "")end[rows, error]end