Re: Embperl, modules, cleanup and the stop button

2001-08-22 Thread Gerald Richter


 My feeling that this cleanup is infact unnecessary (all though worth
 having regardless), as the pipeline nature of the request (call
 database for *all* data required, *then* output), any database calls
 (and corresponding locks) will have completed before the abort
 (SIGPIPE) is recognised.  This should go double for embperl, which
 executes all perl code before outputting any headers and data.


The connection is only aborted, when data is send. So it's true that normaly
there is no abort before the whole page has processed within Embperl., but
there are other reason a page may fail. So it's a good idea to have a
cleanup. In an Embperl page you can define a function called CLEANUP which
will be call _always_, regardless what fails. It will be called after all
content is send to the browser.

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-






Embperl, modules, cleanup and the stop button

2001-08-20 Thread Steve Smith

Hi,

I realise this is covered in part in the modperl guide, but I'd to ask
for a bit of clarification/confirmation ...

I have pages generated with embperl, with each page having it's own
module to pull data from the database and pass it back to page in a
hash, the first line of the embperl page being the call to the module
(a pipeline/callback hybrid, if you like).  This module in turn
creates the appropriate database object.

As the database routines may create table locks, and as I'm using
Apache::DBI, the DB object constructor registers a cleanup handler
that will unlock the tables if an abort has occured
($r-connection-aborted).

My feeling that this cleanup is infact unnecessary (all though worth
having regardless), as the pipeline nature of the request (call
database for *all* data required, *then* output), any database calls
(and corresponding locks) will have completed before the abort
(SIGPIPE) is recognised.  This should go double for embperl, which
executes all perl code before outputting any headers and data.

So I'd like to ask the group, am I right in this analysis, or am I
missing anything here?

Thanks,
Steve