private static Log log = LogFactory.getLog(IbatisLocalTransactionInterceptor.class);
@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
log.debug("[IbatisLocalTransactionInterceptor]进入=》"+methodInvocation.getMethod().getName());
SqlMapClientHolder sqlMapClientHolder = GuiceContext.getInstance().getBean(SqlMapClientHolder.class);
Method method = methodInvocation.getMethod();
Transactional transactional = method.getAnnotation(Transactional.class);
if(transactional == null){
transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
}
TransactionalType type = transactional.type();
IbatisTransaction transaction = sqlMapClientHolder.getIbatisTransaction();
if(transaction.isActive()){
return methodInvocation.proceed();
}