Sha256: 78cde48f9a5ce130e35f52cae3e3a54c262d724eef12f1461ee2878977e54eb5

Contents?: true

Size: 907 Bytes

Versions: 15

Compression:

Stored size: 907 Bytes

Contents

module DataObjects

  module Mysql

    class Transaction < DataObjects::Transaction

      def finalize_transaction
        cmd = "XA END '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

      def begin
        cmd = "XA START '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

      def commit
        cmd = "XA COMMIT '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

      def rollback
        finalize_transaction
        cmd = "XA ROLLBACK '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

      def rollback_prepared
        cmd = "XA ROLLBACK '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

      def prepare
        finalize_transaction
        cmd = "XA PREPARE '#{id}'"
        connection.create_command(cmd).execute_non_query
      end

    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
do_mysql-0.9.10 lib/do_mysql/transaction.rb
do_mysql-0.9.10.1 lib/do_mysql/transaction.rb
do_mysql-0.9.12-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.9.11 lib/do_mysql/transaction.rb
do_mysql-0.9.12-java lib/do_mysql/transaction.rb
do_mysql-0.9.4 lib/do_mysql/transaction.rb
do_mysql-0.9.5 lib/do_mysql/transaction.rb
do_mysql-0.9.12 lib/do_mysql/transaction.rb
do_mysql-0.9.12-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.9.2 lib/do_mysql/transaction.rb
do_mysql-0.9.3 lib/do_mysql/transaction.rb
do_mysql-0.9.9 lib/do_mysql/transaction.rb
do_mysql-0.9.6 lib/do_mysql/transaction.rb
do_mysql-0.9.7 lib/do_mysql/transaction.rb
do_mysql-0.9.8 lib/do_mysql/transaction.rb