JPA Eclispelink - 无法检索最后插入的记录
我的 JPA EclipseLink 有问题。 我有两个功能:首先,它在数据库中正确插入一行。 第二个读取同一个表中的所有值并将其显示给您。问题是它显示了除最后一个引号之外的所有值,为了使其出现,我必须关闭并重新打开应用程序。 我也试过禁用缓存也不行。 您知道如何解决吗? 谢谢
I've a problem with JPA EclipseLink.
I've two functions: First, it inserts a row in the database correctly.
The second reads all the values in the same table and show them to you. The problem is that it shows all the values except the last quote, in order to make this appear, I must close and reopen the application.
I also tried to disable the cache does not work.
Do you have any idea on how to solve?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您如何查询报价?您是在访问 OneToMany 还是使用查询?
如果访问 OneToMany,则可能是缓存问题,您可以禁用该问题进行检查,
http ://wiki.eclipse.org/EclipseLink/FAQ/How_to_disable_the_shared_cache%3F
查询应始终从数据库获取所有对象。确保您提交了插入的对象。
刷新特定查询请参阅
http://wiki.eclipse.org/EclipseLink/示例/JPA/缓存#How_to_refresh_the_cache
How are you querying the quotes? Are you accessing a OneToMany, or using a query?
If accessing a OneToMany, then it could be a caching issues, which you can disable to check,
http://wiki.eclipse.org/EclipseLink/FAQ/How_to_disable_the_shared_cache%3F
A query should always get all objects from the database. Ensure you committed the inserted objects.
The refresh a specific query see,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Caching#How_to_refresh_the_cache