cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: Best practice for "database" manipulation?
Date Tue, 17 Feb 2004 19:31:54 GMT
Bastian Breithaupt wrote:
> Hello:
>>If the logic is contained in avalon components, you'd need to obtain 
>>them first (AFAIR cocoon.newInstance(MYCOMPONENT.ROLE)) and release them
>>afterwards. Remember to release components before creating a 
>>continuation, though.
> I have a flow script:
>        var facade = cocoon.getComponent( Packages.....ROLE );
> 	var cmd = cocoon.request.getParameter("cmd");
> 	if ( cmd == "soSomething" ) {
> 		doSomething( facade , form );
>                 form.finish("page/admin.xsp");
> 	} else {
> 		cocoon.sendPageAndWait("page/admin.xsp");	
> 	}
> The Avalon component is a business facade which sends messages to the logic and delivers
objects to the GUI. Where in this script do I have to realease the component (and how?) ?
> And, by the way, is that a recommended approach?

OK, I'm not the local flow guru so take everything with a grain of
salt or jusk ask someone else ;-)

You should release components before a continuation is created, 
otherwise you risk a memory leak. There have been discussions on
doing it automatically, but AFAIR they were turned down because
of complexity.

A continuation is always created when sendPageAndWait is called, in
addition, you may create continuation explicitly.

Besides, the approach you describe seems perfect.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message