Sha256: efd515da1219f1fde0266e7321c50d80d72d5b98dd4050eff1564e3f934a7c0f

Contents?: true

Size: 788 Bytes

Versions: 80

Compression:

Stored size: 788 Bytes

Contents

module DataObjects

  module Mysql

    class Transaction < DataObjects::Transaction

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

      def commit_prepared
        cmd = "XA COMMIT '#{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

      private

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

    end

  end

end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
do_mysql-0.10.17 lib/do_mysql/transaction.rb
do_mysql-0.10.17-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.17-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.17-java lib/do_mysql/transaction.rb
do_mysql-0.10.16 lib/do_mysql/transaction.rb
do_mysql-0.10.16-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.16-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.16-java lib/do_mysql/transaction.rb
do_mysql-0.10.15 lib/do_mysql/transaction.rb
do_mysql-0.10.15-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.15-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.15-java lib/do_mysql/transaction.rb
do_mysql-0.10.14 lib/do_mysql/transaction.rb
do_mysql-0.10.14-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.14-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.14-java lib/do_mysql/transaction.rb
do_mysql-0.10.13 lib/do_mysql/transaction.rb
do_mysql-0.10.13-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.13-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.13-java lib/do_mysql/transaction.rb