Module: TorqueBox::Transactions::Transaction
- Included in:
- Manager
- Defined in:
- lib/torquebox/transactions.rb
Overview
The default module mixed into the Manager. Adapters for various resources are expected to override these methods as appropriate for their library. See ActiveRecordAdapters::Transaction, for example.
Instance Method Summary collapse
Instance Method Details
#commit ⇒ Object
40 41 42 |
# File 'lib/torquebox/transactions.rb', line 40 def commit @tm.commit end |
#error(exception) ⇒ Object
48 49 50 51 52 |
# File 'lib/torquebox/transactions.rb', line 48 def error( exception ) puts "Transaction rollback: #{exception}" rollback raise end |
#prepare ⇒ Object
36 37 38 |
# File 'lib/torquebox/transactions.rb', line 36 def prepare @tm.begin end |
#rollback ⇒ Object
44 45 46 |
# File 'lib/torquebox/transactions.rb', line 44 def rollback @tm.rollback end |