geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: InvocationResult
Date Sun, 24 Aug 2003 15:23:31 GMT
I should have looked at it more before sending the email.  The code 
should be.

   boolean threwSystemException = true;
   try {
     InvocationResult result = getNext().invoke(invocation);
     threwSystemException = false;
     return result;
   } catch (ApplicationException e) {
     threwSystemException = false;
     throw e;
   } finally {
     EJBInvocationUtil.putEnterpriseContext(invocation, null);
     if (threwSystemException) {
       // invocation threw a system exception so the pool
       // needs to dispose of the context
     } else {
       // return the context to the pool

The code I wrote in the last message for callback was wrong because it 
would include all RuntimeExceptions, Errors, and RemoteException in the 
ApplicationException which is wrong, but you can easily picture the 

I assume you goal it to make code more readable, and I don't think 
hiding an exception in the invocation is the right thing.  That is the 
old C style coding which I hated.  Every time you call something you 
have to write 'if result is an error condition, do something special'.  
Also, there are only a few special interceptors that need to make the 
distinction between application and system exceptions.


  * Dain Sundstrom
  * Partner
  * Core Developers Network

View raw message