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.4.rc1 lib/do_mysql/transaction.rb
do_mysql-0.10.4.rc1-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.4.rc1-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.4.rc1-java lib/do_mysql/transaction.rb
do_mysql-0.10.3 lib/do_mysql/transaction.rb
do_mysql-0.10.3-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.3-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.3-java lib/do_mysql/transaction.rb
do_mysql-0.10.2 lib/do_mysql/transaction.rb
do_mysql-0.10.2-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.2-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.2-java lib/do_mysql/transaction.rb
do_mysql-0.10.1 lib/do_mysql/transaction.rb
do_mysql-0.10.1-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.1-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.1-java lib/do_mysql/transaction.rb
do_mysql-0.10.0-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.0-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.0 lib/do_mysql/transaction.rb
do_mysql-0.10.0-java lib/do_mysql/transaction.rb