Subject: | Autocommit off makes async mode useless |
Date: | Mon, 11 Apr 2016 11:27:54 +0200 |
To: | bug-DBD-Pg [...] rt.cpan.org |
From: | Peter Juhasz <pjuhasz [...] uhusystems.com> |
Hello,
we've run into a rather insidious problem while trying to use DBD::Pg's
support for async queries.
Setting the AutoCommit attribute false will cause the driver to treat
queries as part of an ongoing transaction which must be explicitly
committed or rolled back by the user. However, these transactions are
started automatically and implicitly by the driver, and this is
implemented in DBD::Pg by sending a BEGIN command before the query
itself. And the problem is that this BEGIN is sent in a blocking way,
with PQexec, whether the query is async or not. So in effect, when
there is a network problem or the database response is delayed for any
reason, the supposedly asynchronous application will hang on the first
query of the transaction.
System/version information:
DBI 1.633
DBD::Pg 3.5.1
Linux xxx 4.4.6-200.fc22.x86_64 #1 SMP
This is perl 5, version 20, subversion 3 (v5.20.3) built for x86_64
-linux-thread-multi
best regards,
Peter Juhasz