-
1. Re: which thread should an EJB run in?
ioparra Oct 28, 2003 3:58 PM (in response to n_ton)Please clarify your explanation.
Let me get this straight, you have servlet A with Thread A that creates worker Threads X,Y,Z that all call different EJBs simultaneously. When you do a Thread.getCurrentThread().getName, you are getting the name of the Thread A?
You should have 3 seperate transactions associated with X,Y,Z, respectively. Assuming that each transaction does not interfere with each other(via Pessimistically or DB Row locking), each thread should do their work independantly without knowledge of Thread A.
>>I know that EJBs are running in each of the servlet threads in each servlet call, but how come an EJB doesn't run in a thread spawned by the code?
What do you mean by "thread spawned by the code"? I guess you can force an RMI call by modifing the jndi.properties and setting a provider url.
>>via a timeout
Is this your timeout or a transaction rollback timeout?
-Ivan -
2. Re: which thread should an EJB run in?
n_ton Oct 29, 2003 8:13 AM (in response to n_ton)Yes, you have the situation straight. I don't believe any of the operations in the EJB are doing any blocking. But, as I said, the Thread.getCurrentThread().getName() call in the EJB is showing Thread A.
You can ignore my "spawned by the code" comment. You got the gist of my problem and have basically told me that what I expect is what should happen. So any idea why it doesn't?
The timeout is my own timeout.
Thanx for your help and quick reply.
Norton