WAS数据库连接占用时长

WAS7.0上启用resource-scope为Sharable,也就是开启LTC的情况下,观察发现即便commit并close后feePool里面的连接数都要到请求结束才增加。是否在有LTC的情况下Servlet里取到的数据库连接都在在当次请求响应完毕后才回到连接池,中间即便commit/close连接也都是被LTC持有而进入不了freePool从而其他请求无法获取到该连接的。请教大拿。

参与7

1同行回答

bisubisu售后技术支持SYNNEX
使用shareable方式, LTC的应用程序不能显式commit或回滚在可共享 LTC 中使用的资源管理器连接显示全部

使用shareable方式, LTC的应用程序不能显式commit或回滚在可共享 LTC 中使用的资源管理器连接

收起
IT咨询服务 · 2016-01-13
浏览877
  • LTC中去到的连接是可以显式commt/rollback的,只是经测试即便commit/rollback连接还是在LTC只有交易结束才进入FreePool
    2016-01-16
  • bisu  bisu回复 starffly
    Applications that use shareable LTCs cannot explicitly commit or roll back resource manager connections that are used in a shareable LTC. Although, they can use connections that have an autoCommit capability. This ensures correct encapsulation of connection usage by each component and protects one component from having to make any assumptions about the behavior of other components that share the connection. If an application starts any non-autocommit work in an LTC for which the Resolver attribute is set to Application and the Shareable attribute is set to true, an exception occurs at run time. For example, on a JDBC connection, non-autocommit work is work that the application performs after using the setAutoCommit(false) method to disable the autocommit option on the connection. Enterprise beans that use bean managed transactions (BMT) cannot be assembled with the Shareable attribute set on the LTC configuration. 我上次只翻译了产品文档的一段,这两整段描述的意思大致是用了LTC最好就不要显示的commit/rollback进行干预
    2016-01-17

提问者

starffly
软件开发工程师kk
擅长领域: 应用服务器服务器WAS

相关问题

问题状态

  • 发布时间:2016-01-10
  • 关注会员:4 人
  • 问题浏览:2527
  • 最近回答:2016-01-13
  • X社区推广