Hi all,
Is there a way to tell the container (in declarative way) to make setRollbackOnly for desired exceptions?
If session bean(s) have big amount of business methods (> 100), it is extremely boring and faultfull to put everywhere try catch { setRollbackOnly}.
So I would imagine that in descriptior we could say that for given list of exceptions the container should perform setRollackOnly - nice, clean and easy.
Also second possiblty would be SessionSynchronization.beforeCompletion - possible if the Exception would be passed to this function.
Unluckly I haven't found any such way as above.
Any other idea, how to make it simple and clean?
My idea was to inherit the application exception from runtime exception :) So container will make rollback automaticaly. First it is against the EJB spec, second still plenty of ejb exceptions (inherited directly from Excpetion) are not cought.
Thanks,
Tom