JBoss Community

AbstractRealDeployerWithInput fails to call undeploy() on deployer, for failed deployments

reply from Ales Justin in JBoss Microcontainer - View the full discussion
Consider this:
deploy()
{
  doMyWork();
 
  callThirdPartyCodeWhichCanEndUpThrowingThrowableOrRunTimeException();
}

 

Surely, my deployer/visitor isn't expected to catch Throwable and cleanup whatever I did in doMyWork(), or is it?

Sure it is.

How on earth should I know what a "revert-doMyWork()" looks like? ;-)

 

It should be then

 

deploy()
{
  doMyWork();
   
  try { 
     callThirdPartyCodeWhichCanEndUpThrowingThrowableOrRunTimeException();
  } catch (E e) {
       revertDoMyWork();        
  }
}
 
 
 

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community