public interface SessionScoped
ClientSession bound operations against MongoDB via a SessionCallback.
ClientSession is used for all invocations of execute on the instance.| Modifier and Type | Method and Description |
|---|---|
default <T> T |
execute(SessionCallback<T> action)
Executes the given
SessionCallback within the ClientSession. |
<T> T |
execute(SessionCallback<T> action,
Consumer<com.mongodb.client.ClientSession> doFinally)
Executes the given
SessionCallback within the ClientSession. |
@Nullable default <T> T execute(SessionCallback<T> action)
SessionCallback within the ClientSession.
ClientSession is closed when done.T - return type.action - callback object that specifies the MongoDB action the callback action. Must not be null.@Nullable <T> T execute(SessionCallback<T> action, Consumer<com.mongodb.client.ClientSession> doFinally)
SessionCallback within the ClientSession.
ClientSession is closed when done.T - return type.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).Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.