When is a new thread created for a MDB, is it at ejbCreate or is it at onMessage.
I wrote a utility to map threads to some contexts. I was setting the thread at ejbCreate and trying to retrieve it on onMessage. Suspect the two threads are different. ejbCreate always shows me thread name of main
posted 11 years ago
Threads are not bound to MDBs and other EJBs. Instead, MDBs and session beans are created in pools and left idle until needed. When a request is to be processed, a thread is grabbed from the container's thread pool and given a bean to perform the operation. Once complete, both thread and bean return to their respective pools.
THus the thread(s) that create(s) beans and the ones that use them will likely be different.