users@glassfish.java.net

Re: a problem of thread

From: <glassfish_at_javadesktop.org>
Date: Wed, 15 Apr 2009 07:51:48 PDT

Generally, SLSBs are generated in managed pools by the container. So a single thread can access a single instance of a SLSB at a time. But the container can create as many copies as it wants (ie, a pool of them) to handle all incoming threads. Since a SLSB is truly a stateless service (or should be!), any single instance of that bean can handle any request from any thread. In this regard, stateless session beans are considered thread-safe. And to reiterate, thread usage within an EJB is considered a no-no.

Cheers
[Message sent by forum member 'csiemback' (csiemback)]

http://forums.java.net/jive/thread.jspa?messageID=342263