ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PApp-SQL/SQL.pm
(Generate patch)

Comparing PApp-SQL/SQL.pm (file contents):
Revision 1.4 by root, Sun Nov 26 21:04:22 2000 UTC vs.
Revision 1.5 by root, Sat Jan 6 03:04:03 2001 UTC

73 my ($id, $dsn, $user, $pass, $flags, $connect) = @_; 73 my ($id, $dsn, $user, $pass, $flags, $connect) = @_;
74 # the following line is duplicated in PApp::SQL::Database::new 74 # the following line is duplicated in PApp::SQL::Database::new
75 $id = "$id\0$dsn\0$user\0$pass"; 75 $id = "$id\0$dsn\0$user\0$pass";
76 unless ($dbcache{$id} && $dbcache{$id}->ping) { 76 unless ($dbcache{$id} && $dbcache{$id}->ping) {
77 #warn "connecting to ($dsn|$user|$pass|$flags)\n";#d# 77 #warn "connecting to ($dsn|$user|$pass|$flags)\n";#d#
78 # first, nuke our cache (sooory ;) 78 # first, nuke our statement cache (sooory ;)
79 cachesize cachesize 0; 79 cachesize cachesize 0;
80 # then connect anew 80 # then connect anew
81 $dbcache{$id} = 81 $dbcache{$id} =
82 eval { DBI->connect($dsn, $user, $pass, $flags) } 82 eval { DBI->connect($dsn, $user, $pass, $flags) }
83 || eval { DBI->connect($dsn, $user, $pass, $flags) } 83 || eval { DBI->connect($dsn, $user, $pass, $flags) }
84 || die "$DBI::errstr\n"; 84 || die "unable to connect to database $dsn: $DBI::errstr\n";
85 $connect->($dbcache{$id}) if $connect; 85 $connect->($dbcache{$id}) if $connect;
86 } 86 }
87 $dbcache{$id}; 87 $dbcache{$id};
88} 88}
89 89

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines