a different object with the same identifier value was already associated with the session

错误场景:

文章修改的时候,先使用id把原来的旧文章查出来,然后,获得作者信息,和当前提交修改的session中的用户的用户名进行比对

然后进行验证控制

参考这篇文章,比较老了,

https://blog.csdn.net/u012230055/article/details/40423903

 

hibernate 4这样用 session.clear();

posted @ 2019-03-05 10:53  不打鱼光晒网  阅读(163)  评论(0)    收藏  举报