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.12 lib/do_mysql/transaction.rb
do_mysql-0.10.12-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.12-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.12-java lib/do_mysql/transaction.rb
do_mysql-0.10.11 lib/do_mysql/transaction.rb
do_mysql-0.10.11-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.11-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.11-java lib/do_mysql/transaction.rb
do_mysql-0.10.10 lib/do_mysql/transaction.rb
do_mysql-0.10.10-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.10-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.10-java lib/do_mysql/transaction.rb
do_mysql-0.10.9 lib/do_mysql/transaction.rb
do_mysql-0.10.9-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.9-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.9-java lib/do_mysql/transaction.rb
do_mysql-0.10.8 lib/do_mysql/transaction.rb
do_mysql-0.10.8-x86-mswin32-60 lib/do_mysql/transaction.rb
do_mysql-0.10.8-x86-mingw32 lib/do_mysql/transaction.rb
do_mysql-0.10.8-java lib/do_mysql/transaction.rb