Creating threds in WAS container - Websphere

This is a discussion on Creating threds in WAS container - Websphere ; Hi, I was reading about below API to create some concurrent processing logic as part of my project.I might want to use JNDI resources from the thread i create.. http://java.sun.com/j2se/1.5.0/docs/...e-summary.html I remember people always say it is not a good ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Creating threds in WAS container

  1. Creating threds in WAS container

    Hi,

    I was reading about below API to create some concurrent processing logic as part of my project.I might want to use JNDI resources from the thread i create..

    http://java.sun.com/j2se/1.5.0/docs/...e-summary.html

    I remember people always say it is not a good practice to create threads in the WAS container or WAS container will error out even if
    we create the threads .. ...etc

    But i really i did not understand why should not create threds in the WAS container...

    Can anybody please explain this to me ?

  2. Re: Creating threds in WAS container

    Hi Veera,

    There are many reasons why it is not recommended to create threads inside WAS containers. One reason is that the container attaches "contexts" (such as security credentials, internationalization, etc.) to threads in the container which would not be transferred over to the newly created thread. Further, the java:comp namespace would be inaccessible because the newly created threads do not have the ThreadLocal objects that tie it to the component under which it is executing.

    If you need to execute tasks asynchronously within a WAS container, I would suggest looking into the Work Manager.
    http://publib.boulder.ibm.com/infoce...b_workmgr.html

    Hope this helps,

    Andy

  3. Re: Creating threds in WAS container

    mani_veeras@yahoo.com wrote:
    > Hi,
    >
    > I was reading about below API to create some concurrent processing logic as part of my project.I might want to use JNDI resources from the thread i create..
    >
    > http://java.sun.com/j2se/1.5.0/docs/...e-summary.html
    >
    > I remember people always say it is not a good practice to create threads in the WAS container or WAS container will error out even if
    > we create the threads .. ...etc
    >
    > But i really i did not understand why should not create threds in the WAS container...
    >
    > Can anybody please explain this to me ?


    JEE says don't.

    Ken

  4. Re: Creating threds in WAS container

    Thanks for the response. If it is not recommended then why sun is providing us options like Threads and Concurrent API like above. I would appreciate if you can provide a detailed explanation with some examples.

    Thanks
    Veera

  5. Re: Creating threds in WAS container

    mani_veeras@yahoo.com wrote:
    > Thanks for the response. If it is not recommended then why sun is providing us options like Threads and Concurrent API like above. I would appreciate if you can provide a detailed explanation with some examples.
    >
    > Thanks
    > Veera


    You'll have to ask Sun about examples of using their APIs.

    Ken

+ Reply to Thread