Hibernate reading function shows old data

前端 未结 4 755
梦如初夏
梦如初夏 2020-12-15 12:21

I\'ve a problem showing data from database. If I update an object, sometimes I get the old data, sometimes the new one. Update function works well (I can see in DB the right

4条回答
  •  离开以前
    2020-12-15 12:44

    I have the same problem, my query select * returning old data. I have in my hibernate.cfg.xml file turned off 2nd level cache like this

    false
    false
    0
    

    I'll try add session.flush() or session.clear() before/after transaction.commit() but it not gives positive result

提交回复
热议问题