当你使用spring jpa时,却发现 有以下情况:
问题1 identifier of an instance of .. altered to null
问题2 Batch update returned unexpected row count from update [1]; actual row count: 2; expected: 1
原因:
原因2 hibernate的一级缓存
原因3 Hibernate实体类的瞬时、持久、托管状态的转换与详解、一级缓存(session缓存)与快照、其它API的save与persist细节详解-day02下_ShuYY的博客-优快云博客
原因4 hibernate更新数据方法
解决方法: