Re: global data .....

[prev] [thread] [next] [Date index for 2005/01/29]

From: Perrin Harkins
Subject: Re: global data .....
Date: 05:09 on 29 Jan 2005
On Sat, 2005-01-29 at 00:19 +0200, raptor wrote:
> my mstake i tried with "our" too..

If you do that, you should be able to access it later, provided you use
the full package name.

> U mean closing the connection created by this snippet.. just after I execute it ?
> Browsed the code can't see how to access the dbh !! so that i can close it.

You can access it by calling My::Stuff->db_Main().

> If I try to use created classes later, will they open their own connections ?

Yes.

> Now I see I can try to do Loader-stuff in httpd.conf <Perl></Perl>, if I do it will classes 
> stay for all childrens ?

That's not a good place to do this.  Your startup.pl script, or whatever
Apache::ASP thing is equivalent is better.  You need to make sure you
put it in a package so you know where it is when my need it again:

$My::Stuff::loader = Class::DBI::Loader->new(...

> The Apache::DBI is doing well behind the scenes i.e. caching connetions, isn't it ? 
> or I dont need it 'cause Class::DBI uses Ima::DBI ?

Ima::DBI will call connect_cached, which actually uses Apache::DBI when
Apache::DBI is loaded.  This can be a problem, because Apache::DBI won't
let you call disconnect().  If you are not using transactions inyour
database, I'd suggest you just avoid Apache::DBI and let connect_cached
take care of the persistence instead.  Otherwise, you will have to do
some additional work to make Apache::DBI gets skipped during startup.

- Perrin

(message missing)

global data .....
raptor 19:35 on 28 Jan 2005

Re: global data .....
Perrin Harkins 20:01 on 28 Jan 2005

Re: global data .....
raptor 22:19 on 28 Jan 2005

Re: global data .....
Perrin Harkins 05:09 on 29 Jan 2005

Re: global data .....
raptor 16:54 on 29 Jan 2005

Re: global data .....
Perrin Harkins 02:57 on 30 Jan 2005

Re: global data .....
raptor 16:34 on 30 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52