Is it possible to interrupt a remote EJB method call in a Java Client or a servlet by e.g interrupting the context thread?
If yes whats the excepcted behavior of a the EJB mehtod? Will it complete the transaction or will it rollback the transaction?
Thx
Toby
-
Interruping/Aborting a remote EJB method call (5 messages)
- Posted by: Tobias Rademacher
- Posted on: November 17 2003 16:18 EST
Threaded Messages (5)
- Interruping/Aborting a remote EJB method call by Paul Strack on November 18 2003 08:06 EST
- Bean method calls should be be interupptable by Tobias Rademacher on November 20 2003 11:01 EST
-
Bean method calls should be be interupptable by Paul Strack on November 20 2003 03:40 EST
-
Bean method calls should be be interupptable by Tobias Rademacher on November 21 2003 02:33 EST
- Bean method calls should be be interupptable by Paul Strack on November 21 2003 09:01 EST
-
Bean method calls should be be interupptable by Tobias Rademacher on November 21 2003 02:33 EST
-
Bean method calls should be be interupptable by Paul Strack on November 20 2003 03:40 EST
- Bean method calls should be be interupptable by Tobias Rademacher on November 20 2003 11:01 EST
-
Interruping/Aborting a remote EJB method call[ Go to top ]
- Posted by: Paul Strack
- Posted on: November 18 2003 08:06 EST
- in response to Tobias Rademacher
There is no standard way to interupt EJB operations from a client. The EJB server does not allow you control over EJB threads. If you want interruptable remote operations, I suggest you use a messaging architecture rather than EJBs. Messaging works better for long run operations anyway. -
Bean method calls should be be interupptable[ Go to top ]
- Posted by: Tobias Rademacher
- Posted on: November 20 2003 11:01 EST
- in response to Paul Strack
There is no standard way to interupt EJB operations from a client. The EJB server does not allow you control over EJB threads. If you want interruptable remote operations, I suggest you use a messaging architecture rather than EJBs. Messaging works better for long run operations anyway.
How can I contact someone of the mysterious ;-) bean writers or the JCP team to suggest to integrate it into the upcomming spec releases (I guess for 2.1 its to late :( ).
JMS or maybe some JINI/JavaSpace stuff is fine, but it seems to be harder to create a request-response style processing build on top on JMS. :-) -
Bean method calls should be be interupptable[ Go to top ]
- Posted by: Paul Strack
- Posted on: November 20 2003 15:40 EST
- in response to Tobias Rademacher
EJBs are designed to be synchronous operations. In other words, the client blocks until the EJB operation is complete. Since the client can't perform any work until the EJB method returns, there is no straightforward way for the client to interrupt the EJB. In light of that fact it is extremely unlikely that the EJB specification will ever support operation interruption.
If you want to have long running operations that can be interrupted, an asynchronous, message-based system is a much better way to go. Building request/response operation in JMS is not, in fact, particular hard (using reply-to queues), and it will be a much better solution than EJB for interruptable remote operations. -
Bean method calls should be be interupptable[ Go to top ]
- Posted by: Tobias Rademacher
- Posted on: November 21 2003 02:33 EST
- in response to Paul Strack
EJBs are designed to be synchronous operations. In other words, the client blocks until the EJB operation is complete. Since the client can't perform any work until the EJB method returns, there is no straightforward way for the client to interrupt the EJB. In light of that fact it is extremely unlikely that the EJB specification will ever support operation interruption.
>
> If you want to have long running operations that can be interrupted, an asynchronous, message-based system is a much better way to go. Building request/response operation in JMS is not, in fact, particular hard (using reply-to queues), and it will be a much better solution than EJB for interruptable remote operations.
Okay then we have a a possible solution for this. Another related question: What happens if the user kills, close or crash? The current EJB method is still active on server, isn't it? As far as I know the bean spec does not talks about this???? -
Bean method calls should be be interupptable[ Go to top ]
- Posted by: Paul Strack
- Posted on: November 21 2003 09:01 EST
- in response to Tobias Rademacher
If client dies while an EJB method calls is being executed, the EJB method should still complete. EJB methods will only terminate abnormally for server-side errors. Most of the time, this is a good thing.
This is typically behavior for client/server applications. Servlets behave the same way, as do JMS applications, web services, etc ...