Module: Imparcial::Driver::AbstractExpression::Transaction
- Included in:
- Imparcial::Driver::AbstractExpression
- Defined in:
- lib/imparcial/driver/abstract/expression/transaction.rb
Instance Method Summary collapse
-
#create_savepoint(options = {}) ⇒ Object
Description Stablish a savepoint in a given moment during transactions.
-
#initialize_transaction ⇒ Object
Description Initiate a transaction.
-
#restore_savepoint(options = {}) ⇒ Object
Description Rollback to a given savepoint.
-
#rollback_transaction ⇒ Object
Description Rollback a transaction.
-
#terminate_transaction ⇒ Object
Description Terminate a transaction by commiting.
Instance Method Details
#create_savepoint(options = {}) ⇒ Object
Description
Stablish a savepoint in a given moment during transactions.
Usage
abstract_adapter.create_savepoint :savepoint_name => ‘here’
Options
-
:savepoint_name
Returning
nothing
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/imparcial/driver/abstract/expression/transaction.rb', line 28 def create_savepoint ( = {} ) , query sql_for_saving_point( ) rescue adapter_specific_exception => ex raise TransactionError.new(ex.) end |
#initialize_transaction ⇒ Object
Description
Initiate a transaction.
Usage
abstract_adapter.initialize_transaction
Options
no options
Returning
nothing
86 87 88 89 90 91 92 93 94 |
# File 'lib/imparcial/driver/abstract/expression/transaction.rb', line 86 def initialize_transaction query sql_for_initializing_a_transaction rescue adapter_specific_exception => ex raise TransactionError.new(ex.) end |
#restore_savepoint(options = {}) ⇒ Object
Description
Rollback to a given savepoint.
Usage
abstract_adapter.restore_savepoint :savepoint_name => ‘here’
Options
-
:savepoint_name
Returning
nothing
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/imparcial/driver/abstract/expression/transaction.rb', line 62 def restore_savepoint ( = {} ) , query sql_for_rolling_back( ) rescue adapter_specific_exception => ex raise TransactionError.new(ex.) end |
#rollback_transaction ⇒ Object
Description
Rollback a transaction.
Usage
abstract_adapter.rollback_transaction
Options
no options
Returning
nothing
130 131 132 133 134 135 136 137 138 |
# File 'lib/imparcial/driver/abstract/expression/transaction.rb', line 130 def rollback_transaction query sql_for_rolling_back rescue adapter_specific_exception => ex raise TransactionError.new(ex.) end |
#terminate_transaction ⇒ Object
Description
Terminate a transaction by commiting.
Usage
abstract_adapter.terminate_transaction
Options
no options
Returning
nothing
108 109 110 111 112 113 114 115 116 |
# File 'lib/imparcial/driver/abstract/expression/transaction.rb', line 108 def terminate_transaction query sql_for_terminating_a_transaction rescue adapter_specific_exception => ex raise TransactionError.new(ex.) end |