J2CA0075W 處理方法 allocateMCWrapper 時應該存在活動的事務

來源:互聯網
上載者:User

應用系統在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的話,將給出以上警告。消除該警告的方法參考上文的方法。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.