Hibernate 3.2.1.ga 缓存数据
我继承了一个由struts2 + hibernate 3.2.1 ga组成的Java EE web应用程序,部署在Jboss 4.3上。
该应用程序似乎没有反映间歇性进行的数据库更改。数据库中的值是正确的,但当我访问应用程序时,这些值有时会显示旧记录。 我对冬眠非常陌生,所以任何想法都将不胜感激。
编辑:我最初说过这些更改不会得到反映,这是不准确的,更改确实会显示,但刷新时它们会恢复到旧值。
I've inherited a Java EE webapp composed of struts2 + hibernate 3.2.1 ga deployed on Jboss 4.3.
The application doesn't seem to reflect database changes made intermittently. The values are correct in the database, but when I access the app, the values sometimes show the old records.
I am extremely green to hibernate, so any thoughts are greatly appreciated.
Edit: I had originally stated that the changes are not ever reflected, this was inaccurate, the changes do show up, but on refresh they revert back to the old values.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您的应用程序正在使用二级缓存,并且某些更新是在 Hibernate 后面使用 SQL 更新查询完成的。
这将使二级缓存不知道实体已进行更新,因此应用程序仍会显示从二级缓存获取的过时数据。
Maybe your app is using a second-level cache, and some of the updates are done in the back of Hibernate, using SQL update queries.
This would make the second-level cache unaware that an update has been made to the entity, and the app would thus still show stale data fetched from the second-level cache.