> In my startup.perl, i use a module "db" which does:
>
> $db = DBIx::Database->new({
> '!DataSource'=>'dbi:mysql:mydatabase',
> '!LinkName' => 1,
> '!Reconnect' => 1,
> });
>
> *table1=DBIx::Recordset->Setup({
> '!DataSource'=>$db,
> '!Table'=>'mytable',
> });
>

You can't do this in startup.pl, because this will open the database handle
in the Apache parent process and share this database handle accross all
processes. This normaly doesn't work correctly (As you just proof on your
own).

Do the Database -> new in your startup.pl, this will read in all the
metadata and do the setup of the Recordset object inside your page (or in a
module whichyou call from your page), so you get a separate database handle
for each Apache child process. Apache::DBI will take care that the handles
are kept open.

>
> I would also prefer that an sql error in a page shouldn't even interfere
> with other invocations of that same page.
>

If you don't open the db handles in the parent process, then they will not
interfere with other invocations of that same page.


Gerald

-------------------------------------------------------------
Gerald Richter    ecos 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
-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to