Class: Synapse::UnitOfWork::OuterCommitUnitOfWorkListener Private
- Inherits:
-
UnitOfWorkListener
- Object
- UnitOfWorkListener
- Synapse::UnitOfWork::OuterCommitUnitOfWorkListener
- Defined in:
- lib/synapse/uow/nesting.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Listener that allows a nested unit of work to properly operate within in a unit of work that is not aware of nesting
Instance Method Summary collapse
- #after_commit(outer_unit) ⇒ undefined private
- #initialize(inner_unit, provider) ⇒ undefined constructor private
- #on_cleanup(outer_unit) ⇒ undefined private
- #on_rollback(outer_unit, cause = nil) ⇒ undefined private
Methods inherited from UnitOfWorkListener
#on_event_registered, #on_prepare_commit, #on_prepare_transaction_commit, #on_start
Constructor Details
#initialize(inner_unit, provider) ⇒ undefined
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.
250 251 252 253 |
# File 'lib/synapse/uow/nesting.rb', line 250 def initialize(inner_unit, provider) @inner_unit = inner_unit @provider = provider end |
Instance Method Details
#after_commit(outer_unit) ⇒ undefined
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.
257 258 259 |
# File 'lib/synapse/uow/nesting.rb', line 257 def after_commit(outer_unit) @inner_unit.perform_inner_commit end |
#on_cleanup(outer_unit) ⇒ undefined
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.
276 277 278 |
# File 'lib/synapse/uow/nesting.rb', line 276 def on_cleanup(outer_unit) @inner_unit.perform_cleanup end |
#on_rollback(outer_unit, cause = nil) ⇒ undefined
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.
264 265 266 267 268 269 270 271 272 |
# File 'lib/synapse/uow/nesting.rb', line 264 def on_rollback(outer_unit, cause = nil) @provider.push @inner_unit begin @inner_unit.perform_rollback cause ensure @provider.clear @inner_unit end end |