myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <>
Subject Re: Automated transaction handling
Date Wed, 07 Feb 2007 13:25:43 GMT
Werner Punz schrieb:

>> IMO, such handling would be very convenient to ensure a common and
>> safe exception handling. It would also provide a common place for
>> exception logging.

Ok another pattern, to solve this problem in an automated way.
Use Spring use automated transactions, and also use AOP.
You define beans with business methods under transactional scope
you execute them
the commit rollback is done automated.
in case of an exception add an AOP Layer around those beans
with an interceptor who does the logging.

on the ui layer add a navigation handler to the mix, which pushes in
case of the exception the user into an error page.

This should resolve most use cases without mixing the layers.

You probably get similar results in EJB3 on an app server which supports

but things like controlled exception handling recovery/logging with
automated mechanisms probably is really a classical domain for aspect
oriented programming.

I highly recommend to take a short time of reading into the Spring
framework to get more insight and new tools for such usecases.

View raw message