session
抛出异常: a different object with the same identifier value was already associated with the session:
意思是:session中存在主键值相等但是不是同一个对象的记录,类似于数据库中不能存在两条主键值相等的不同记录一样
一般发生在update的时候
解决方法: 1.session.update() 改成session.merge()
<span style="color:red">2</span>.把session关闭,只让session一次性管理一条一模一样的记录