Module: TorqueBox::Transactions::ActiveRecordAdapters::Transaction Private
- Included in:
- Manager
- Defined in:
- lib/torquebox/active_record_adapters.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #commit ⇒ Object private
- #connections ⇒ Object private
- #error(exception) ⇒ Object private
- #prepare ⇒ Object private
- #rollback ⇒ Object private
- #should_commit?(connection) ⇒ Boolean private
- #should_rollback?(connection) ⇒ Boolean private
Instance Method Details
#commit ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 90 91 92 |
# File 'lib/torquebox/active_record_adapters.rb', line 87 def commit raise ActiveRecord::Rollback if @rolled_back super @complete = true connections.each { |connection| connection.commit_transaction_records } end |
#connections ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
115 116 117 |
# File 'lib/torquebox/active_record_adapters.rb', line 115 def connections @connections ||= Set.new end |
#error(exception) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
82 83 84 85 |
# File 'lib/torquebox/active_record_adapters.rb', line 82 def error( exception ) super rescue ActiveRecord::Rollback end |
#prepare ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
75 76 77 78 79 80 |
# File 'lib/torquebox/active_record_adapters.rb', line 75 def prepare super # TODO: not this, but we need AR's pooled connection to # refresh from jboss *after* the transaction is begun. ActiveRecord::Base.clear_active_connections! end |
#rollback ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
94 95 96 97 98 99 100 |
# File 'lib/torquebox/active_record_adapters.rb', line 94 def rollback super @complete = true connections.each do |connection| connection.rollback_transaction_records(@transactions.empty?) end end |
#should_commit?(connection) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
102 103 104 105 106 |
# File 'lib/torquebox/active_record_adapters.rb', line 102 def should_commit?(connection) return true if @complete || !active? connections << connection false end |
#should_rollback?(connection) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
108 109 110 111 112 113 |
# File 'lib/torquebox/active_record_adapters.rb', line 108 def should_rollback?(connection) return true if @complete || !active? connections << connection @rolled_back = true false end |