Return-Path: Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 17942 invoked by uid 500); 11 Jul 2003 14:15:43 -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 17926 invoked from network); 11 Jul 2003 14:15:43 -0000 Received: from mail.gmx.net (213.165.64.20) by daedalus.apache.org with SMTP; 11 Jul 2003 14:15:43 -0000 Received: (qmail 24523 invoked by uid 65534); 11 Jul 2003 14:15:43 -0000 Received: from unknown (EHLO WRPO) (62.116.51.50) by mail.gmx.net (mp027) with SMTP; 11 Jul 2003 16:15:43 +0200 Reply-To: From: =?iso-8859-1?Q?Reinhard_P=F6tz?= To: Subject: RE: Flow Database stuff ( The new FOM? ) Date: Fri, 11 Jul 2003 16:13:59 +0200 Message-ID: <001501c347b6$acf20cf0$05506bc2@WRPO> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <7462791C-B3A6-11D7-AFAD-0003935AD2EE@media.demon.co.uk> Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > From: Jeremy Quinn=20 >=20 > On Thursday, July 10, 2003, at 09:04 AM, Reinhard P=F6tz wrote: >=20 > > > > IMO no. I would use Object/Relational mapping tools like OJB=20 > > http://db.apache.org/ojb/ or Hibernate=20 > > (http://hibernate.bluemars.net). > > > > > >> Is there a wiki somewhere on this type of thing? > > > > http://wiki.cocoondev.org/ > > Wiki.jsp?page=3DXMLFormJXFormHibernateAndFlowscr > > ipt > > and here you find a component providing a Hibernate session: > > http://cvs.werken.com/viewcvs.cgi/plexus-components/hibernate > > /src/java/org/apache/plexus/hibernate/=20 > > DefaultHibernateService.java?cvsro > > ot=3Dplexus > > >=20 > Forgive me if I have not entirely understood the usage=20 > patterns of the =20 > classes above. IIUC this component provides a Hibernate Session. At the current FOM implementation you have to take care that you open and close these sessions correctly. >=20 > However, with the generous assistance of Ugo Cei, I am successfully =20 > using the technique highlighted in the first sample here [1] for =20 > managing Hibernate Sessions in my FlowApp. >=20 > The basic issue is that you want to avoid maintaining an open=20 > Hibernate =20 > Session whilst the user is interacting with a form (etc.).=20 > The Session =20 > should to be opened and closed during each Request (and any=20 > Transient =20 > Beans refreshed before re-use). The above technique uses a Servlet =20 > Filter to manage this, with a static method to retrieve a Session in =20 > your flowscript at the beginning of each Request that needs it. >=20 > [1] http://hibernate.bluemars.net/43.html >=20 Sounds cool and I remember that I've already heard from it but haven't found the time to try it myself. I would like to use this Avalon component mentioned above and the Flow interpreter takes care of releasing (and providing) stateful components within my scripts. So I would have to lookup the Hibernate Session at the beginning(2) and until I=20 finally release(8) it I don't have to take care for it. 1 function xxx() { 2 var hibS =3D cocoon.getComponent( "hibernateSession" ); 3 var custBean =3D hibS.blablabla // get your beans with hibernate 4 sendPageAndWait( "bla", {customer : custBean} ); 5 // do something (updates, reads, whatever) 6 var someDifferentBean =3D hibS.blalbalba 7 sendPageAndWait( "bla", {diff : someDifferentBean } ); 8 sendPageAndRelease( "thankYou", {} ); 9 } This would be IMO a very elegant way and IIU the recent discussion correctly possible from a technical point of view. Maybe Chris can comment on this :-) Thoughts? Cheers, Reinhard