Carl Johnstone wrote:
The subroutine will only be defined once at file load time so the reference
to it won't change.
Thinking about it, depending where you define the @dsns variable I suggested
won't necessarily work that much better. You need to make sure it's declared
in a namespace where it won't get redefined - effectively you want to ensure
that you only ever define that array once, then the reference to it won't
ever change.
Or *if* you do need to change the DSN list without restarting mod_perl you
need to do something that's a bit more of a work-around.
Carl
Ok, i see what you're saying. I declaired a global with the array and
then refernced it as you suggested.
6202 Apache::DBI new connect to
'database=ssAccess;host=localhostserverspyserverspyAutoCommit=1PrintError=0Username=serverspymx_connect_mode=ignore_errorsmx_dsns=ARRAY(0x8682158)mx_error_proc=CODE(0x85fa3e0)mx_exit_mode=first_successmx_master_id=dbserver1'
6202 Apache::DBI new connect to
'database=ssAccess;host=localhostserverspyserverspyAutoCommit=1PrintError=0Username=serverspymx_connect_mode=ignore_errorsmx_dsns=ARRAY(0x8682158)mx_error_proc=CODE(0x85fa3e0)mx_exit_mode=first_successmx_master_id=dbserver1'
6202 Apache::DBI new connect to
'database=ssAccess;host=localhostserverspyserverspyAutoCommit=1PrintError=0Username=serverspymx_connect_mode=ignore_errorsmx_dsns=ARRAY(0x8682158)mx_error_proc=CODE(0x85fa3e0)mx_exit_mode=first_successmx_master_id=dbserver1'
6202 Apache::DBI new connect to
'database=ssAccess;host=localhostserverspyserverspyAutoCommit=1PrintError=0Username=serverspymx_connect_mode=ignore_errorsmx_dsns=ARRAY(0x8682158)mx_error_proc=CODE(0x85fa3e0)mx_exit_mode=first_successmx_master_id=dbserver1'
6202 Apache::DBI new connect to
'database=ssAccess;host=localhostserverspyserverspyAutoCommit=1PrintError=0Username=serverspymx_connect_mode=ignore_errorsmx_dsns=ARRAY(0x8682158)mx_error_proc=CODE(0x85fa3e0)mx_exit_mode=first_successmx_master_id=dbserver1'
Looks like that fixed the array address but Apache::DBI still seems to
be struggling holding onto the connection.
Pierre