Package org.cxbox.model.core.tx
Class TransactionServiceImpl
- java.lang.Object
-
- org.cxbox.model.core.tx.TransactionServiceImpl
-
- All Implemented Interfaces:
TransactionService
@Service("transactionService") public class TransactionServiceImpl extends Object implements TransactionService
-
-
Field Summary
-
Fields inherited from interface org.cxbox.api.service.tx.TransactionService
SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description TransactionServiceImpl(List<javax.persistence.EntityManager> entityManagers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()<T,E extends RuntimeException>
voidinvokeAfterCompletion(Invoker<T,E> invoker)<T,E extends Throwable>
TinvokeInNewRollbackOnlyTx(Invoker<T,E> invoker)<T,E extends Throwable>
TinvokeInNewROTx(Invoker<T,E> invoker)<T,E extends Throwable>
TinvokeInNewTx(Invoker<T,E> invoker)<T,E extends Throwable>
TinvokeInTx(Invoker<T,E> invoker)<T,E extends Throwable>
TinvokeNoTx(Invoker<T,E> invoker)booleanisActive()booleanisRollbackOnly()voidsetRollbackOnly()<T> TwoAutoFlush(Invoker<T,RuntimeException> invoker)
-
-
-
Constructor Detail
-
TransactionServiceImpl
public TransactionServiceImpl(List<javax.persistence.EntityManager> entityManagers)
-
-
Method Detail
-
invokeInTx
@Transactional(propagation=REQUIRED) public <T,E extends Throwable> T invokeInTx(Invoker<T,E> invoker) throws E extends Throwable
- Specified by:
invokeInTxin interfaceTransactionService- Throws:
E extends Throwable
-
invokeInNewTx
@Transactional(propagation=REQUIRES_NEW) public <T,E extends Throwable> T invokeInNewTx(Invoker<T,E> invoker) throws E extends Throwable
- Specified by:
invokeInNewTxin interfaceTransactionService- Throws:
E extends Throwable
-
invokeNoTx
@Transactional(propagation=NOT_SUPPORTED) public <T,E extends Throwable> T invokeNoTx(Invoker<T,E> invoker) throws E extends Throwable
- Specified by:
invokeNoTxin interfaceTransactionService- Throws:
E extends Throwable
-
invokeInNewRollbackOnlyTx
@Transactional(propagation=REQUIRES_NEW) public <T,E extends Throwable> T invokeInNewRollbackOnlyTx(Invoker<T,E> invoker) throws E extends Throwable
- Specified by:
invokeInNewRollbackOnlyTxin interfaceTransactionService- Throws:
E extends Throwable
-
invokeInNewROTx
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public <T,E extends Throwable> T invokeInNewROTx(Invoker<T,E> invoker) throws E extends Throwable- Specified by:
invokeInNewROTxin interfaceTransactionService- Throws:
E extends Throwable
-
isRollbackOnly
public boolean isRollbackOnly()
- Specified by:
isRollbackOnlyin interfaceTransactionService
-
setRollbackOnly
public void setRollbackOnly()
- Specified by:
setRollbackOnlyin interfaceTransactionService
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceTransactionService
-
invokeAfterCompletion
public <T,E extends RuntimeException> void invokeAfterCompletion(Invoker<T,E> invoker) throws E extends RuntimeException
- Specified by:
invokeAfterCompletionin interfaceTransactionService- Throws:
E extends RuntimeException
-
woAutoFlush
@Transactional public <T> T woAutoFlush(Invoker<T,RuntimeException> invoker)
- Specified by:
woAutoFlushin interfaceTransactionService
-
flush
public void flush()
- Specified by:
flushin interfaceTransactionService
-
-