| Class | Transaction::Simple::ThreadSafe::Group |
| In: |
lib/transaction/simple/threadsafe/group.rb
|
| Parent: | Transaction::Simple::Group |
A transaction group is an object wrapper that manages a group of objects as if they were a single object for the purpose of transaction management. All transactions for this group of objects should be performed against the transaction group object, not against individual objects in the group. This is the threadsafe version of a transaction group.
# File lib/transaction/simple/threadsafe/group.rb, line 23
23: def initialize(*objects)
24: @objects = objects || []
25: @objects.freeze
26: @objects.each { |obj| obj.extend(Transaction::Simple::ThreadSafe) }
27:
28: if block_given?
29: begin
30: yield self
31: ensure
32: self.clear
33: end
34: end
35: end