JPA not receiving updated data

后端 未结 1 1319
天命终不由人
天命终不由人 2021-01-25 07:35

I use a managedBean that goes into the db and defines the bean properties with db data. However when I update the db the data I receive in my bean is not updated.

The q

相关标签:
1条回答
  • 2021-01-25 08:11

    Reason that you get old value is that your entity is stored in second level cache. And when you request it second time no database call is executed, but value from memory is returned.

    You can disable cache by adding <property name="eclipselink.cache.shared.default" value="false"/> to property section of your persistence.xml

    0 讨论(0)
提交回复
热议问题