Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
I have a question regarding how DB connections work within a single process perl script. Hope someone doesn't mind giving me a few pointers. If I was to have a sub routine that setups a connection and returns a connection handler variable (or perhaps a reference), such as the code shown below. If I then call this sub everytime I need to make a query (my $dbh = &dbConnect), am I right in thinking that a new connection would NOT be openend every time but that DBI would use an existing connection if one existed and was not already in use; assuming that I hadn't yet called disconnect() My second question is: Is the connection opened on the call to connect or is it delayed until the first query is prepared? Regards to all,
In reply to DBI / Mysql connections by cyril
|
|