applicationContext.xml中配置:
。。。。。。
aop:config
/aop:config
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
Service 文件中
package web.impl.service;
。。。。。
public class PictureServiceImpl implements PictureServiceAware {
。。。。。。
pictureDao.addPicture(picture);//保存到数据库
throw new Exception("");
}
怎么数据库还是有插入数据呢?
没有问题。配置文件也发来吧
抛出RuntimeException异常。或者配置事物处理异常
应该不会出现这种问题,你检查看看PictureServiceImpl 是否被aop的代理。
或者把dao,action 函数发来看看