@Component(value="blStreamingTransactionCapableUtil") @Scope(value="prototype") public class StreamingTransactionCapableUtil extends Object implements StreamingTransactionCapable
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
em |
protected int |
pageSize |
protected org.springframework.transaction.PlatformTransactionManager |
platformTransactionManager |
protected int |
retryMax |
| Constructor and Description |
|---|
StreamingTransactionCapableUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected <G extends Throwable> |
endTransaction(org.springframework.transaction.TransactionStatus status,
boolean error,
Class<G> exceptionType,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
int |
getPageSize()
The result set size per page of data when streaming.
|
int |
getRetryMax() |
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
void |
init() |
void |
runOptionalEntityManagerInViewOperation(Runnable runnable)
Executes the Runnable operation in the scope of an Entity-Manager-In-View pattern, if there is not already an
EntityManager on the thread.
|
<G extends Throwable> |
runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType,
boolean useTransaction)
Run an operation inside of a single transaction.
|
<G extends Throwable> |
runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType,
boolean useTransaction,
int transactionBehavior,
int isolationLevel) |
<G extends Throwable> |
runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType,
boolean useTransaction,
int transactionBehavior,
int isolationLevel,
boolean readOnly,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
<G extends Throwable> |
runStreamingTransactionalOperation(StreamCapableTransactionalOperation streamOperation,
Class<G> exceptionType)
Run a streaming operation inside a transaction.
|
<G extends Throwable> |
runStreamingTransactionalOperation(StreamCapableTransactionalOperation streamOperation,
Class<G> exceptionType,
int transactionBehavior,
int isolationLevel) |
<G extends Throwable> |
runTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType)
Run an operation inside of a single transaction.
|
<G extends Throwable> |
runTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType,
int transactionBehavior,
int isolationLevel) |
<G extends Throwable> |
runTransactionalOperation(StreamCapableTransactionalOperation operation,
Class<G> exceptionType,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
void |
setPageSize(int pageSize) |
void |
setRetryMax(int retryMax) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
protected org.springframework.transaction.TransactionStatus |
startTransaction(int propagationBehavior,
int isolationLevel,
boolean isReadOnly,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
protected org.springframework.transaction.PlatformTransactionManager platformTransactionManager
protected javax.persistence.EntityManager em
@Value(value="${streaming.transaction.lock.retry.max}")
protected int retryMax
@Value(value="${streaming.transaction.item.page.size}")
protected int pageSize
@PostConstruct public void init()
public <G extends Throwable> void runStreamingTransactionalOperation(StreamCapableTransactionalOperation streamOperation, Class<G> exceptionType) throws G extends Throwable
StreamingTransactionCapableStreamCapableTransactionalOperation API to determine
the page of data to work on within the transaction scope.runStreamingTransactionalOperation in interface StreamingTransactionCapableGG extends Throwablepublic <G extends Throwable> void runStreamingTransactionalOperation(StreamCapableTransactionalOperation streamOperation, Class<G> exceptionType, int transactionBehavior, int isolationLevel) throws G extends Throwable
runStreamingTransactionalOperation in interface StreamingTransactionCapableG extends Throwablepublic <G extends Throwable> void runTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType) throws G extends Throwable
StreamingTransactionCapableTransactionalOperation.execute().runTransactionalOperation in interface StreamingTransactionCapableGG extends Throwablepublic <G extends Throwable> void runTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType, org.springframework.transaction.PlatformTransactionManager transactionManager) throws G extends Throwable
runTransactionalOperation in interface StreamingTransactionCapableG extends Throwablepublic <G extends Throwable> void runTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType, int transactionBehavior, int isolationLevel) throws G extends Throwable
runTransactionalOperation in interface StreamingTransactionCapableG extends Throwablepublic <G extends Throwable> void runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType, boolean useTransaction) throws G extends Throwable
StreamingTransactionCapableTransactionalOperation.execute(). The useTransaction parameter
allows the inclusion of some logic to determine whether or not the creation of the transaction is required for the operation. This is
useful in situations where there may already be an active transaction that you want to use, if available.runOptionalTransactionalOperation in interface StreamingTransactionCapableGG extends Throwablepublic <G extends Throwable> void runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType, boolean useTransaction, int transactionBehavior, int isolationLevel) throws G extends Throwable
runOptionalTransactionalOperation in interface StreamingTransactionCapableG extends Throwablepublic void runOptionalEntityManagerInViewOperation(Runnable runnable)
StreamingTransactionCapablerunOptionalEntityManagerInViewOperation in interface StreamingTransactionCapablepublic <G extends Throwable> void runOptionalTransactionalOperation(StreamCapableTransactionalOperation operation, Class<G> exceptionType, boolean useTransaction, int transactionBehavior, int isolationLevel, boolean readOnly, org.springframework.transaction.PlatformTransactionManager transactionManager) throws G extends Throwable
runOptionalTransactionalOperation in interface StreamingTransactionCapableG extends Throwablepublic int getPageSize()
StreamingTransactionCapableStreamingTransactionCapable.runStreamingTransactionalOperation(StreamCapableTransactionalOperation, Class).getPageSize in interface StreamingTransactionCapablepublic void setPageSize(int pageSize)
setPageSize in interface StreamingTransactionCapablepublic org.springframework.transaction.PlatformTransactionManager getTransactionManager()
getTransactionManager in interface StreamingTransactionCapablepublic void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
setTransactionManager in interface StreamingTransactionCapablepublic int getRetryMax()
getRetryMax in interface StreamingTransactionCapablepublic void setRetryMax(int retryMax)
setRetryMax in interface StreamingTransactionCapableprotected <G extends Throwable> void endTransaction(org.springframework.transaction.TransactionStatus status, boolean error, Class<G> exceptionType, org.springframework.transaction.PlatformTransactionManager transactionManager) throws G extends Throwable
G extends Throwableprotected org.springframework.transaction.TransactionStatus startTransaction(int propagationBehavior,
int isolationLevel,
boolean isReadOnly,
org.springframework.transaction.PlatformTransactionManager transactionManager)
Copyright © 2019. All rights reserved.