乐观锁异常
session.save(classEntity);//级联操作 /* for (StudentEntity student:studentEntity){ session.save(student); } */
只添加班级,系统通过级联添加学生就会报错javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
但是只保存学生,系统就会自动级联保存班级这样就是正常的,
有大佬清楚问题吗?我代码块里只有一个session事务