Package io.tesler.model.core.tx
Class TransactionServiceImpl
- java.lang.Object
-
- io.tesler.model.core.tx.TransactionServiceImpl
-
- All Implemented Interfaces:
TransactionService
@Service("transactionService") public class TransactionServiceImpl extends Object implements TransactionService
-
-
Field Summary
-
Fields inherited from interface io.tesler.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 void
flush()
<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)
boolean
isActive()
boolean
isRollbackOnly()
void
setRollbackOnly()
<T> T
woAutoFlush(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:
invokeInTx
in 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:
invokeInNewTx
in 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:
invokeNoTx
in 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:
invokeInNewRollbackOnlyTx
in 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:
invokeInNewROTx
in interfaceTransactionService
- Throws:
E extends Throwable
-
isRollbackOnly
public boolean isRollbackOnly()
- Specified by:
isRollbackOnly
in interfaceTransactionService
-
setRollbackOnly
public void setRollbackOnly()
- Specified by:
setRollbackOnly
in interfaceTransactionService
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceTransactionService
-
invokeAfterCompletion
public <T,E extends RuntimeException> void invokeAfterCompletion(Invoker<T,E> invoker) throws E extends RuntimeException
- Specified by:
invokeAfterCompletion
in interfaceTransactionService
- Throws:
E extends RuntimeException
-
woAutoFlush
@Transactional public <T> T woAutoFlush(Invoker<T,RuntimeException> invoker)
- Specified by:
woAutoFlush
in interfaceTransactionService
-
flush
public void flush()
- Specified by:
flush
in interfaceTransactionService
-
-