-
1. Re: Long-running Session beans
ianmarshall Mar 16, 2005 4:16 AM (in response to zurchman)If the thread of execution of your polling stateless session bean cannot yield to other threads before it finishes execution (others may help you here), one work-around could be to split your polling into discrete tasks which can be invoked in succession but with time intervals between them.
If your design allows this splitting of polling, then you could convert your session bean into a stateful one and invoke the relevant method more often. The session bean could then perform one of the discrete polling tasks at each invocation. The bean's state can then be used to decide which polling task to perform each time. -
2. Re: Long-running Session beans
zurchman Mar 16, 2005 11:35 PM (in response to zurchman)
The Stateful session bean is a good idea.
For the sake of expedience, I now have the MBean firing an EJB client which triggers the polling through the original Stateless bean's local interface.
That approach primarily buys me Thread.yield() with no hidden consequences.