transaction (ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)

    # File lib/active_record/connection_adapters/postgresql_adapter.rb, line 542
          def transaction(start_db_transaction = true)
            transaction_open = false
            begin
              if block_given?
                if start_db_transaction
                  begin_db_transaction
                  transaction_open = true
                end
                yield
              end
            rescue Exception => database_transaction_rollback
              if transaction_open && transaction_active?
                transaction_open = false
                rollback_db_transaction
              end
              raise unless database_transaction_rollback.is_a? ActiveRecord::Rollback
            end
          ensure
            if transaction_open && transaction_active?
              begin
                commit_db_transaction
              rescue Exception => database_transaction_rollback
                rollback_db_transaction
                raise
              end
            end
          end