@Autowired
TransactionAttributeSource transactionAttributeSouce;
@Around("this(loxia.dao.ReadWriteSupport)")
public Object doQuery(ProceedingJoinPoint pjp) throws Throwable{
MethodSignature ms = (MethodSignature)pjp.getSignature();
TransactionAttribute ta = transactionAttributeSouce.getTransactionAttribute(ms.getMethod(), pjp.getTarget().getClass());
if(ta == null || (ReadWriteStatusHolder.getReadWriteStatus() != null && ta.getPropagationBehavior() != TransactionDefinition.PROPAGATION_REQUIRES_NEW)){
return pjp.proceed(pjp.getArgs());
}
logger.debug("determine datasource for query:{}.{}",ms.getDeclaringType().getName(),ms.getMethod().getName());
logger.debug("Current operation's transaction status: {}", ta == null ? "null": ta.toString());
String currentStatus = ReadWriteStatusHolder.getReadWriteStatus();
if(ta != null){
if(ta.getPropagationBehavior() == TransactionDefinition.PROPAGATION_REQUIRES_NEW){