public enum SessionSynchronization extends Enum<SessionSynchronization>
SessionSynchronization is used along with MongoTemplate to define in which type of transactions to
participate if any.MongoTemplate.setSessionSynchronization(SessionSynchronization),
MongoDatabaseUtils.getDatabase(MongoDatabaseFactory, SessionSynchronization),
ReactiveMongoTemplate.setSessionSynchronization(SessionSynchronization),
ReactiveMongoDatabaseUtils.getDatabase(ReactiveMongoDatabaseFactory, SessionSynchronization)| Enum Constant and Description |
|---|
ALWAYS
Synchronize with any transaction even with empty transactions and initiate a MongoDB transaction when doing so by
registering a MongoDB specific
ResourceHolderSynchronization. |
NEVER
Do not participate in ongoing transactions.
|
ON_ACTUAL_TRANSACTION
Synchronize with native MongoDB transactions initiated via
MongoTransactionManager. |
| Modifier and Type | Method and Description |
|---|---|
static SessionSynchronization |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SessionSynchronization[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SessionSynchronization ALWAYS
ResourceHolderSynchronization.public static final SessionSynchronization ON_ACTUAL_TRANSACTION
MongoTransactionManager.public static final SessionSynchronization NEVER
public static SessionSynchronization[] values()
for (SessionSynchronization c : SessionSynchronization.values()) System.out.println(c);
public static SessionSynchronization valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.