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 ...

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 ?

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.

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

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

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