开发者

Is there any way of interrupting a stateful session bean?

This question is somewhat related to Handling a timeout in EJB3 without using threads.

Background: I have an example of an operation that may lock up while it's running, and I have to be able to handle that eventuality and kill the operation if so happens. The solution has to be application server agnostic, so container managed transactions with timout values are not an option.

Actual Question: One idea for a solution that I had running the operation in a stateful session bean, and using an external @Timeout method to开发者_JS百科 monitor it, but for this to work I need to be able to interrupt or cancel that session bean. Is there any way of doing this?


The spec says (§4.3.14):

The container serializes calls to each stateful and stateless session bean instance. Most containers will support many instances of a session bean executing concurrently; however, each instance sees only a serialized sequence of method calls. Therefore, a stateful or stateless session bean does not have to be coded as reentrant.

There is thus no way of calling a session bean instance's method while another method of the same instance is still running.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜