You could look at Jini for this, which has a Transactions API that allows distributed systems to deal with partial failure, rollback, all of that. Here's a
link to an introductory article. It might be a useful starting point to getting the code you want to see. Didn't want to drill down myself.
------------------
Michael Ernest, co-author of:
The Complete Java 2 Certification Study Guide [This message has been edited by Michael Ernest (edited January 24, 2001).]