J2CA0075W 处理方法 allocateMCWrapper 时应该存在活动的事务

应用系统在websphere5.1环境小运行,SystemOut.log 文件不断打出以下warming语句
[06-5-9 17:01:44:778 GMT+08:00] 3945f948 ConnectionMan W J2CA0075W: 处理方法 allocateMCWrapper 时应该存在活动的事务。
[06-5-9 17:01:44:803 GMT+08:00] 3945f948 ConnectionMan W J2CA0075W: 处理方法 initializeForUOW 时应该存在活动的事务。

websphere的文档解释如下:
***********************************************************
Cause

These messages are being produced due to an "unsupported" environment. When application has spun its own threads from an EJB, accessing a database is not supported (per the J2EE specification). If a Servlet is spinning its own threads and accessing a database, the J2EE specification is not clear on this, so WebSphere Application Server 5.0 will allow it at this time. IBM is working with Sun to clarify this in the specification, so eventually (i.e. J2EE 1.4) spun threads from a Servlet accessing a database outside of a transaction will not be supported either.

Since we don't want to promote the usage of these "naked" threads accessing databases, we are producing the warning messages. Although they may be filling up the logs, we feel that these are necessary to warn the user that they are doing something not in-line with the intended usage. Customers should consider changing their application to comply with the
J2EE specification.


Solution

The temporary fix to suppress these warning messages from log file is to modify the file j2c.properties which can be found in the $WAS_HOME/properties directory ($WAS_HOME is the directory where WebSphere Application Server 5.0.x is installed) and
add the following line to the file:


false

***********************************************************
具体原因就是在websphere环境下如果从非WebSphere创建的线程(如servlet)中访问datasource的Connection的话,将给出以上警告。消除该警告的方法参考上文的方法。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值