Naked Threads in WebSphere App Server

Discussions

General J2EE: Naked Threads in WebSphere App Server

  1. Naked Threads in WebSphere App Server (3 messages)

    With WAS5.x, we get the following warning messages, for any db activity performed from "non-managed threads":
     
    7/14/04 23:01:53:161 MST] 20253e89 ConnectionMan W J2CA0075W: An active transaction should be present while processing method allocateMCWrapper.
    [7/14/04 23:01:53:164 MST] 20253e89 ConnectionMan W J2CA0075W: An active transaction should be present while processing method initializeForUOW.
     
    This is what WAS documentation says for these warning messages:

    ***********************************************************
    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:


    <logMissingTranContext>false</logMissingTranContext>
     
    =============================================================
     
    So, now, we have an option to suppress these warning messages.. but my question is, for long term purposes,
    whether there is a viable solution to the real problem of doing db activity from non-managed threads.
     Also, in a websphere environment, what are other alternatives to using non-managed threads to do background processing?

    Threaded Messages (3)

  2. www.devet.net[ Go to top ]

    www.devet.net
  3. www.devet.net[ Go to top ]

    http://www.devet.net
  4. Did you find any alternate approach for the same...if so please help me out. Thanks in advance.