开发者

Updated data (in Database) is not visible via JPA/Eclipselink [duplicate]

This question already has answers here: Spring Data JPA Update @Query not updating? (5 answers) Closed 2 years ago.

I have Oracle DB and Java project which is connected to the DB using JPA/Eclipselink.

The problem is that when some data updated in the database (manually using Oracle SQL developer), this data is not visible 开发者_如何转开发via JPA, only old values.

What can cause such problems?


Please try em.refresh()
JPA's EntityManager will be unaware of any changes you made outside its transaction till it reloads the data. Above command will make it reload the data.

If it is a List (populated using select), then you'll need to reload it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜