Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 45640 invoked from network); 7 Feb 2007 13:26:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2007 13:26:46 -0000 Received: (qmail 53690 invoked by uid 500); 7 Feb 2007 13:26:47 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 53645 invoked by uid 500); 7 Feb 2007 13:26:47 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 53634 invoked by uid 99); 7 Feb 2007 13:26:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2007 05:26:47 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gcjmu-myfaces-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2007 05:26:36 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HEmoE-0005Wl-N0 for users@myfaces.apache.org; Wed, 07 Feb 2007 14:26:02 +0100 Received: from 195.78.47.10 ([195.78.47.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Feb 2007 14:26:02 +0100 Received: from werner.punz by 195.78.47.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Feb 2007 14:26:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: users@myfaces.apache.org From: Werner Punz Subject: Re: Automated transaction handling Date: Wed, 07 Feb 2007 14:25:43 +0100 Lines: 28 Message-ID: References: Reply-To: werner.punz@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 195.78.47.10 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) In-Reply-To: Sender: news X-Virus-Checked: Checked by ClamAV on apache.org 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 AOP. 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.