08 2018 档案
摘要:今天发现配置的事务不生效 事务已经按上次的配好了,而且使用cglib代理也打开了,抛异常时,仍然不能回滚, 最后发现,是同类调用不能生效 列举几个事务不生效的场景: 1.私有方法事务不生效 2.同类调用不生效 3.如果使用的是rollbakfor的默认,已检查的异常(所有派生自Error和Runti
阅读全文
摘要:两种配置事务的方式 1.非注解式事务配置 2. 注解式事务配置 非注解式事务配置 <!-- 基本数据源配置 --><bean id="parentDataSource" class="org.apache.commons.dbcp.BasicDataSource"><property name="m
阅读全文
摘要:@RunWith(SpringJUnit4ClassRunner.class) 让junit处于spring环境中 @ContextConfiguration(locations = {"classpath:context/spring-config-context.xml", "classpath*:/spring-libra.xml"}) 配置spring配置文件 @TransactionCo...
阅读全文

浙公网安备 33010602011771号