服务器启动警告:warn org.springframework.aop.framework.Cglib2AopProxy (转)
服务器启动出现以下警告:WARN [org.springframework.aop.framework.Cglib2AopProxy] - <Unable to proxy method [public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.Hibernate...
服务器启动出现以下警告:
WARN [org.springframework.aop.framework.Cglib2AopProxy] - <Unable to proxy method [
public final org.hibernate.SessionFactory org.springframework.orm.hibernate3.support.
HibernateDaoSupport.getSessionFactory()] because it is
final: All calls to this method via a proxy will be routed directly to the proxy.>
你aop:pointcut声明包含了无法代理的method
1,是你将声明式事务放到了DAO层,而hibernateDAOSupport里那些final method不能够被代理.
2,自己所写的类中,被事务管理的方法是final型的,也无法被代理。
危害:All calls to this method via a proxy will be routed directly to the proxy.会产生脏数据的,这是spring事物管理报的错,如果不处理数据就很危险了。
原因:spring的事物代理是继承你写的类,然后在你的基础上加事物管理,final的他继承不了,故而无法对其进行事务管理,所以会给出警告,该方法同时也无法进行事务管理!
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)