Method: Mongo::Session#unpin_maybe
- Defined in:
- lib/mongo/session.rb
#unpin_maybe(error, connection = nil) ⇒ Object
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.
Unpins this session from the pinned server or connection, if the session was pinned and the specified exception instance and the session’s transaction state require it to be unpinned.
The exception instance should already have all of the labels set on it (both client- and server-side generated ones).
885 886 887 888 889 890 891 892 893 894 895 896 897 |
# File 'lib/mongo/session.rb', line 885 def unpin_maybe(error, connection = nil) if !within_states?(Session::NO_TRANSACTION_STATE) && error.label?('TransientTransactionError') then unpin(connection) end if committing_transaction? && error.label?('UnknownTransactionCommitResult') then unpin(connection) end end |