summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
130d462)
- Prevent: MySQL server has gone away
+my $DBI_CACHE=0; # Cache DBI requests - may cause: MySQL server has gone away
+
+
open DBI_PWD,$DBI_pwd or die "open \"$DBI_pwd\": $!";
$DBI_pwd=<DBI_PWD>;
close DBI_PWD or warn "close DBI_pwd: $!";
open DBI_PWD,$DBI_pwd or die "open \"$DBI_pwd\": $!";
$DBI_pwd=<DBI_PWD>;
close DBI_PWD or warn "close DBI_pwd: $!";
+ return $DBI if $DBI_CACHE && $DBI;
$DBI=DBI->connect("DBI:mysql:database=$DBI_database;host=","$DBI_user",$DBI_pwd,{
"PrintError"=>0, # handled by "RaiseError" below
"RaiseError"=>1,
$DBI=DBI->connect("DBI:mysql:database=$DBI_database;host=","$DBI_user",$DBI_pwd,{
"PrintError"=>0, # handled by "RaiseError" below
"RaiseError"=>1,