如何在 Tomcat 6 中标记连接以从池中逐出

发布于 2024-09-11 06:58:11 字数 352 浏览 4 评论 0原文

我们有一个使用 Oracle StoredProc 的应用程序。当存储过程从应用程序外部升级或重新编译时,必须关闭并重新打开数据库连接。否则我们会得到 Oracle 异常 ORA-20003。

到目前为止,我们一直在使用特定于 WebLogic 的解决方案,在该解决方案中,我们会抛出特定的异常,并且 Weblogic 连接池会将连接标记为逐出。我们现在正在转向 Tomcat 6。Tomcat

6 有类似的解决方案吗?或者甚至更好,一个通用的解决方案?

我们可以将连接池配置为 minIdle=0 和 timeBetweenEvictionRunsMillis=一些小数字,但仍然没有保证,只能缓解问题。

感谢您的帮助 !

We have an application using an Oracle StoredProc. When the stored proc is upgraded or recompiled from outside of our application, the database connections have to be closed and reopened. Otherwise we get an Oracle Exception ORA-20003.

Until now, we were using a WebLogic specific solution, where we were throwing a specific Exception and the Weblogic connection pool would mark the connection for eviction. We are now moving to Tomcat 6.

Is there a similar solution for Tomcat 6 ? Or even better, a generic solution ?

We could configure our connection pool with minIdle=0 and timeBetweenEvictionRunsMillis=some small number, but there still would be no garantie, only a mitigation of the problem.

Thanks for your help !

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

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

发布评论

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

评论(1

潦草背影 2024-09-18 06:58:11

您能否提出一个 SELECT 语句来验证连接是否是最新的?如果是这样,您可以使用它来配置连接池 validationQuery< /a> (可能与 connectionInitSqls 组合)。

编辑:也许 USER_OBJECTS.LAST_DDL_TIME 可以有帮助吗?

Can you come up with a SELECT statement that would validate whether the connection is up to date? If so, you could use it to configure the connection pool with validationQuery (potentially combined with connectionInitSqls).

Edit: Perhaps USER_OBJECTS.LAST_DDL_TIME can be of some help?

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