All,
I'm sure that this is covered somewhere in the documentation or on this
list, if I could just find the right way to ask the question. So please feel
free to send me off to read something.
I currently have a web system with an architecture like this:
+------------+
| UI CGI scripts (foo.pl)
| using CGI.pm
+------------+
|
|
+------------+
| Business objects
| (like documents)
+------------+
|
|
+-------------+
| Database objects
| -basically perl
| objects on views
+-------------+
|
|
+--------------+
| Database interface (db_ora.pm)
| layer (Oracle now,
| but soon to have the
| choice of PostgreSQL
| or SQLServer)
+---------------+
|
|
+----------------+
| DBI/DBD
+----------------+
Converting all the globals to Module variables has been a piece of cake, but
I've run into one big issue. Depending on how you log into the system, the
user will connect to different databases. When they do this, I store the
Database Handle from DBI/DBD as $main::dbh. This variable has the scope of
"the length of processing the request" and then should become undef. Easy
under normal CGI, because you start with a whole new memory space. If I make
this a variable in db_ora.pm, it then is persistant "forever"--or until I
restart apache. If I make it a local in foo.pl, it has the right lifespan,
but I can't figure out how to address is down in db_ora.pm--particularly
with it's not just "foo.pl" but 50 different top-level scripts.
Can someone help? Pointer to documentation? Am I staring at something so
obvious that it would bite me?
Thanks in advance,
Walt Knowles
#---------------------------------------------------------------------
# Walter Knowles iRepository.net -- Lucidoc (tm)
# CEO and Systems Architect any document any time
# [EMAIL PROTECTED] any where
# (425) 822-2441 x 1 www.lucidoc.com
#---------------------------------------------------------------------