On 2/28/06, Mark Martinec <[EMAIL PROTECTED]> wrote:
> Brian,
>
> > Can anyone else confirm that reconnection does not work with
> > PostgreSQL? Im suspecting that the line:
> > eval { $self->dbh->begin_work(@_) }; # line 9575 of amavisd 2.3.3
> > always returns true for the DBD::Pg module regardless of the state of
> > the connection. Therefore constantly making false attempts to store
> > sql information with save_info_preliminary() if the connection is
> > actually lost.
>
> Seems like PostgreSQL returns status 7 in such case,
> while MySQL returns either 2006 or 2013.
>
> Could you please add the '7' to the list in sub execute, e.g.:
>
> --- amavisd.orig Mon Aug 22 01:46:15 2005
> +++ amavisd Wed Mar 1 01:27:01 2006
> @@ -9639,8 +9639,11 @@
> eval { $sth->execute(@args) };
> if ($@ ne '') {
> - my($err) = $@; chomp($err); my($msg) = "sql execute: sts=$DBI::err,
> $err";
> - if (!$sth || ($sth->err ne '2006' && $sth->err ne '2013')) {
> - die $msg;
> - } else { # MySQL specific: server has gone away; Lost connection to...
> + my($err) = $@; chomp($err); my($msg) = "sts=" . $DBI::err . ", $err";
> + if (!$sth) {
> + die "sql execute (no handle): ".$msg;
> + } elsif ($sth->err ne '2006' && $sth->err ne '2013' && $sth->err ne '7')
> {
> + die "sql execute: ".$msg;
> + } else { # Server has gone away; Lost connection to...
> + # MySQL: 2006, 2013; PostgreSQL: 7
> if ($self->{in_transaction}) {
> $self->disconnect_from_sql;
I have no idea what I was thinking when I said it was the begin_work
failing when the logs clearly said it was the execute. Thanks, ill
test this out.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/