cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@informatik.tu-darmstadt.de>
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.

HTH

	Chris.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message