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.
238 239 240 241 |
# File 'lib/synapse/uow/nesting.rb', line 238 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.
245 246 247 |
# File 'lib/synapse/uow/nesting.rb', line 245 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.
264 265 266 |
# File 'lib/synapse/uow/nesting.rb', line 264 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.
252 253 254 255 256 257 258 259 260 |
# File 'lib/synapse/uow/nesting.rb', line 252 def on_rollback(outer_unit, cause = nil) @provider.push @inner_unit begin @inner_unit.perform_rollback cause ensure @provider.clear @inner_unit end end |