I have a question regarding the scope of a global database handle localized by the local command.
My global database handle is declared in my apache configuration file as follows:
--------------------------------------------------------
PerlSetVar MasonAllowGlobals $dbh
--------------------------------------------------------
$dbh is the database handle.
I am using the local command in my top level autohandler like this:
-----------------------------------------------------------------------------------------------------------------------------------
local $dbh = DBI->connect($data_source,$user,$pass) or die "Can't connect to database.<br>";
------------------------------------------------------------------------------------------------------------------------------------
(I am using Apache::DBI, by the way.)
My question is, after I localize it in my top level autohandler, who will be able to use this *localized* database handle?
Will all the components that I call with $m->comp use this *localized* database handle? Does it make a difference where in the hierarchy I call $m->comp?
Thanks
My global database handle is declared in my apache configuration file as follows:
--------------------------------------------------------
PerlSetVar MasonAllowGlobals $dbh
--------------------------------------------------------
$dbh is the database handle.
I am using the local command in my top level autohandler like this:
-----------------------------------------------------------------------------------------------------------------------------------
local $dbh = DBI->connect($data_source,$user,$pass) or die "Can't connect to database.<br>";
------------------------------------------------------------------------------------------------------------------------------------
(I am using Apache::DBI, by the way.)
My question is, after I localize it in my top level autohandler, who will be able to use this *localized* database handle?
Will all the components that I call with $m->comp use this *localized* database handle? Does it make a difference where in the hierarchy I call $m->comp?
Thanks
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users