@api semipublic
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 73 def close_connection(connection) super unless current_connection.equal?(connection) end
Retrieve the current transaction for this Adapter.
Everything done by this Adapter is done within the context of this Transaction.
@return [Transaction]
the 'current' transaction for this Adapter.
@api private
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 60 def current_transaction transactions.last end
@api semipublic
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 68 def open_connection current_connection || super end
Pop the 'current' Transaction from the per thread Transaction stack so that everything done by this Adapter is no longer necessarily within the context of said Transaction.
@return [Transaction]
the former 'current' transaction.
@api private
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 47 def pop_transaction transactions.pop end
Pushes the given Transaction onto the per thread Transaction stack so that everything done by this Adapter is done within the context of said Transaction.
@param [Transaction] transaction
a Transaction to be the 'current' transaction until popped.
@return [Array(Transaction)]
the stack of active transactions for the current thread
@api private
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 35 def push_transaction(transaction) transactions << transaction end
Produces a fresh transaction primitive for this Adapter
Used by Transaction to perform its various tasks.
@return [Object]
a new Object that responds to :close, :begin, :commit, and :rollback,
@api private
# File lib/dm-transactions/adapters/dm-do-adapter.rb, line 16 def transaction_primitive if current_transaction && supports_savepoints? DataObjects::SavePoint.create_for_uri(normalized_uri, current_connection) else DataObjects::Transaction.create_for_uri(normalized_uri) end end
Generated with the Darkfish Rdoc Generator 2.