Package org.mybatis.cdi
Class LocalTransactionInterceptor
- java.lang.Object
-
- org.mybatis.cdi.LocalTransactionInterceptor
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
JtaTransactionInterceptor
@Interceptor public class LocalTransactionInterceptor extends java.lang.Object implements java.io.Serializable
Best-effort interceptor for local transactions. It locates all the instances ofSqlSssionManager
and starts transactions on all them. It cannot guarantee atomiticy if there is more than oneSqlSssionManager
. Use XA drivers, a JTA container and theJtaTransactionInterceptor
in that case.- Author:
- Frank David MartÃnez
- See Also:
JtaTransactionInterceptor
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalTransactionInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
beginJta()
protected void
endJta(boolean isExternaTransaction, boolean commit)
protected Transactional
getTransactionalAnnotation(javax.interceptor.InvocationContext ctx)
java.lang.Object
invoke(javax.interceptor.InvocationContext ctx)
Invoke.protected boolean
isTransactionActive()
-
-
-
Method Detail
-
invoke
public java.lang.Object invoke(javax.interceptor.InvocationContext ctx) throws java.lang.Exception
Invoke.- Parameters:
ctx
- the ctx- Returns:
- the object
- Throws:
java.lang.Exception
- the exception
-
isTransactionActive
protected boolean isTransactionActive() throws javax.transaction.SystemException
- Throws:
javax.transaction.SystemException
-
beginJta
protected void beginJta() throws javax.transaction.NotSupportedException, javax.transaction.SystemException
- Throws:
javax.transaction.NotSupportedException
javax.transaction.SystemException
-
endJta
protected void endJta(boolean isExternaTransaction, boolean commit) throws javax.transaction.SystemException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException
- Throws:
javax.transaction.SystemException
javax.transaction.RollbackException
javax.transaction.HeuristicMixedException
javax.transaction.HeuristicRollbackException
-
getTransactionalAnnotation
protected Transactional getTransactionalAnnotation(javax.interceptor.InvocationContext ctx)
-
-