Gateway interface to execute ClientSession bound operations against MongoDB via a SessionCallback.
The very same bound ClientSession is used for all invocations of execute on the instance.
Executes the given SessionCallback within the ClientSession.
It is up to the caller to make sure the ClientSession is closed when done.
Type Parameters:
T - return type.
Parameters:
action - callback object that specifies the MongoDB action the callback action. Must not be null.
doFinally - callback object that accepts ClientSession after invoking SessionCallback. This
Consumer is guaranteed to be notified in any case (successful and exceptional outcome of
SessionCallback).
Returns:
a result object returned by the action. Can be null.