如何在 Tomcat 6 中标记连接以从池中逐出
我们有一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否提出一个
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 withvalidationQuery
(potentially combined withconnectionInitSqls
).Edit: Perhaps
USER_OBJECTS.LAST_DDL_TIME
can be of some help?