The throwExceptionForRetry is just a wrapper service around the existing error method within webMethods. They introduced this in the 6.1 version. The real error method is ISRuntimeException. Generally a flow service will throw one of two types of errors -
com.wm.pkg.art.error.DetailedSystemException (Runtime) this is the one you want
com.wm.pkg.art.error.DetailedServiceException (Service) logic/data type errors.
Unfortunately not all services or adapters throw the Runtime error, which is why I said you have to make sure your check for it or another type of error that would be considered a runtime exception.
For example The webMethods JDBC adapter will throw a com.wm.pkg.art.error.DetailedSystemException if it cannot connect to a database. You can catch this and then apply the throwExceptionforRetry outside of the catch block. This will cause the document to be resubmitted.
The WmDB adapter will not throw this error. It relies on the jdbc driver to pass back the error in the dbmessage or dbconnection variable. You then have to evalute whether it is an exception for which you want to retry or if it is a logic or data exception. The service will not do this for you. Again the throwExceptionForRetry outside of the catch block.
All of the webMethods adapters and built in services handle this differently. So you have to get to know the adapter or service and what type of errors it throws. There is nothing from preventing you from throwing the throwExceptionForRetry on a data or logic problem. It will put you into a nice endless loop.
Number of retries is really up to you, you can give it a limited number or deliver until successful. Whatever makes you sleep better.
markg
http://darth.homelinux.net
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services