标签:c style class blog code java
问题描述: 写主库开事务的情况下会导致时不时的将更新/插入操作写入到从库上, 导致mysqlException
public class DataSourceAdvice implements MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice { private static final Logger LOG = LoggerFactory.getLogger(DataSourceAdvice.class); @Override public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable { DataSourceSwitcher.clearDataSource(); } }
Transaction事务注解和DynamicDataSource动态数据源切换问题解决,布布扣,bubuko.com
Transaction事务注解和DynamicDataSource动态数据源切换问题解决
标签:c style class blog code java
原文地址:http://www.cnblogs.com/zhwbqd/p/3757060.html