Return-Path: Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 85253 invoked by uid 500); 13 Jul 2003 09:42:16 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 85147 invoked from network); 13 Jul 2003 09:42:15 -0000 Received: from mail.gmx.de (HELO mail.gmx.net) (213.165.64.20) by daedalus.apache.org with SMTP; 13 Jul 2003 09:42:15 -0000 Received: (qmail 16739 invoked by uid 65534); 13 Jul 2003 09:42:27 -0000 Received: from pD9EF42AF.dip0.t-ipconnect.de (EHLO WRPO) (217.239.66.175) by mail.gmx.net (mp027) with SMTP; 13 Jul 2003 11:42:27 +0200 Reply-To: From: =?iso-8859-1?Q?Reinhard_P=F6tz?= To: Subject: RE: Flow Database stuff ( The new FOM? ) Date: Sun, 13 Jul 2003 11:40:38 +0200 Message-ID: <000b01c34922$d469b900$af42efd9@WRPO> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N From: Jeremy Quinn [mailto:jeremy@media.demon.co.uk] > By passing a Bean persisted by Hibernate from the flow layer to the > view layer, you are implementing SoC by allowing the view layer to > decide what is relevant for that view. This aspect not being > the Flow's > concern. Only to make it transparent (for me): The flow layer passes e.g. a user bean with the id 4711 to the view layer. The view layer only "knows" that it can expect a user bean and has tho show e.g. the name and the adress and so it doesn't care where the bean comes from (database, webservice, ...). Do we agree on this? > > However, once you have triggered the view layer with > SendPageAndWait(), > control does not return to the flow layer until the Response has been > sent and the next Request received, thus loosing you the > opportunity to > close the Hibernate Session from the Flow layer before the > Response is > sent. Chris' experimental implementation of cocoon.getComponent() should solve this problem. > SendPage() might not suffer this problem, but due to the nature of a > SAX event pipeline, I would not bet on it. > > With 'lazy initialisation' SQL Queries are only made when getter > methods of the Bean are executed. If you have passed the Bean to the > view layer, XPath expressions in JXPathTemplate (etc.) will result in > those getter methods being accessed. If your flowscript has already > released it's Hibernate Component, you are in trouble. > > You could clone the Bean to pass it to the view layer, but it is kind > of self-defeating IMHO. Why do you think it is self-defeating? IIUC the point of lazy initialization is calling the persistence layer at the time when it is really needed (when I generate some output). If I pass the bean with sendPageAndWait("myPage", {bean:bean}) I *already know* that I need this bean - otherwise I wouldn't pass it, wouldn't I? Cheers, Reinhard