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',
});

(and more tables, some with lengthy definitions)

Then all my pages do things like
        $db::table1->Search()

Now that I think about it, is what I'm doing subject to race conditions?
Should I instead employ a sub for each table in "db"? Will this slow me
down or take up a lot more memory?

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


On Fri, Feb 08, 2002 at 02:43:04PM +0100, Gerald Richter wrote:
> > Is there any way I can prevent my entire embperl site from falling apart
> > when any single page generates sql errors?
> >
> 
> Normaly there shouldn't be any problems for other pages then the one that
> has the error into. At least I never have seen this, also I have sometimes
> errors in my SQL too.
> 
> Can you give a small example that shows what you are doing?
> 
> >
> > followed by lots of "Can't call method "Search" on an undefined value".
> >
> 
> That's maybe because you use the value that is return from the failing call
> as Recordset object and because of the error this value is undefined, but
> this should matter in other pages....
> 
> 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]
> 
> 

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

Reply via email to