在基于toplink和struts 2的应用程序中,即使提交数据后数据也会从数据库中消失

发布于 2024-08-08 12:47:50 字数 409 浏览 3 评论 0原文

我有一个 struts 2 应用程序和一个在 tomcat 6.0.20 上运行的 toplink 持久性提供程序,以及在 GNU/Linux 计算机上运行的 MySql 5.1.38 服务器。提交数据后,当我去检索它时,数据已从数据库中消失。

我在执行查询后执行 em.commit()em.flush() 。它们是如何消失的?我正在使用所有标准配置文件。我减少了mysql中的wait_timeoutinteractive_timout周期。我还在我的 persistence.xml 中使用 autoReconnectforPools

我还在每个用户注销时使缓存失效。

有什么想法吗?

I have a struts 2 application and a toplink persistence provider running on tomcat 6.0.20 and a MySql 5.1.38 server on a GNU/Linux machine. After committing the data the when i go to retrieve it the data it has disappeared from the database.

I do a em.commit() and em.flush() after my queries have executed. How do they disappear? I am using all standard configuration files. I have reduced the wait_timeout and the interactive_timout period in mysql. Also am using autoReconnectforPools in my persistence.xml.

I also invalidate the cache on every users logout.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夢归不見 2024-08-15 12:47:50

无论如何,没关系,通过从 persistence.xml 的实体类型声明中删除 softweak 并在其位置添加hardweak 解决了问题。

anyway it does not matter, the problem was solved by removing softweak from persistence.xml's entity type declaration and adding hardweak in its place.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文