[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
dmi method + an exception?  XML
Forum Index -> General
Author Message
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

Hello!

As I've got a DMI call, it's something that will run across the cluster.
But is it allow to throw an exception within a DMI method.
node1 proceed well,
node2 throws an exception Ex1.
node3 throws an exception Ex2.
What will be the result for the callee thread. How to catch Ex1 and Ex2?
Is there something that may help to rollback the work on the node1?

Easy way is to not allow exceptions. But what to do if you've got a failure on nodeX?
Or on all nodes?

thank you in advance,
alexander efremov
tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

The exception is ignored and you cannot catch it as it runs asynchronously.

What are you trying to do exactly? Most of the time DMI is not the right solution so I ask this question.

If you want remote execution and want to handle the exception then you might consider a command strategy.

There is a sample strategy pattern implemented in the tclib framework.

http://svn.terracotta.org/svn/forge/projects/labs/tim-tclib/trunk/samples/strategy/readme.html

Here a future is returned so that you can inspect the results of the call.
[WWW]
efremov

neo

Joined: 06/14/2008 13:34:09
Messages: 7
Offline

I want to run something over all nodes that uses local resources. And that something has rights to fail.
I'm looking for a way to notify the callee thread about a failure.
Command pattern you refer to is just a java.lang.Runnable. Thus there's no way to throw an exception.
I try to understand what you mean but cant grasp your thoughts.
tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

hmm I thought there was a Callable version there too. If not it would be easy to add.
[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.7 © JForum Team