T
- public class ReadOnlyAndReadWriteTransactionConversionTemplate<T> extends Object
Constructor and Description |
---|
ReadOnlyAndReadWriteTransactionConversionTemplate(org.springframework.transaction.PlatformTransactionManager transactionManager) |
Modifier and Type | Method and Description |
---|---|
T |
executeInReadOnly(Supplier<T> inReadOnlyCallback,
Supplier<T> notInReadOnlyCallback)
Checks if the current transaction is in readonly mode, and creates a new transaction in readonly mode if not.
|
T |
executeInReadWrite(Supplier<T> callback)
Checks if the current transaction is in read/write mode, and creates a new transaction in read/write mode if not.
|
public ReadOnlyAndReadWriteTransactionConversionTemplate(org.springframework.transaction.PlatformTransactionManager transactionManager)
public T executeInReadOnly(Supplier<T> inReadOnlyCallback, Supplier<T> notInReadOnlyCallback)
inReadOnlyCallback
- To be executed if the current transaction is in readonly mode.notInReadOnlyCallback
- To be executed in a new read only transaction if the current transaction is not in readonly mode.Copyright © 2003–2020 Atlassian. All rights reserved.