在 websphere 7 中关闭数据库连接失败(托管连接清理失败),但在 websphere 6.1 中则不然

发布于 2024-08-28 19:14:19 字数 362 浏览 2 评论 0原文

我有一个简单的方法(通过 servlet 在 Web 应用程序中使用),它从 JNDI 名称获取连接并发出选择语句(最后获取连接、发出选择、返回结果、关闭连接等)。由于应用程序中的其他方法,连接设置为 autocommit=false。此方法在 websphere 6.1 以及 glassfish 和 weblogic 中正常工作。但是,在 websphere 7 中,当我关闭连接时,它会收到清理失败错误,因为它表示连接仍处于事务中。因为我没有更新任何内容,所以我没有在此方法中提交或回滚连接(这可能是错误的)。如果我在关闭连接之前添加提交,它就会起作用。我的问题是为什么它可以在 websphere 6.1 (和其他容器)中工作,而为什么不能在 websphere 7 中工作?造成这种差异的原因是什么?

I have a simple method (used in a web application through servlets) that gets a connection from a JNDI name and issues a select statement (get connection, issue select, return result, close the connection etc. in finally). Due to other methods in the application the connection is set as autocommit=false. This method works normally in websphere 6.1 as well as in glassfish and weblogic. However, in websphere 7, it receives cleanup failed error when I close the connection because, it says, the connection is still in a transaction. Because I was not updating anything I did not commit or rollback the connection in this method (which can be wrong). If I add commit before closing the connection, it works. My question is why it works in websphere 6.1 (and other containers) and why not in websphere 7 ? What can be the cause of this difference ?

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

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

发布评论

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

评论(1

潜移默化 2024-09-04 19:14:19

请查看管理控制台、服务器设置和事务服务设置。 7.x 和 6.x 中的默认设置有所不同。

Please look at the Administrative Console, server settings, and the transaction service settings. The default settings differ in 7.x and 6.x.

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