[pgpool-general: 1877] current transaction is aborted, commands ignored
Sean Hogan
sean at compusult.net
Mon Jul 8 22:40:04 JST 2013
Hello Tatsuo et al.,
I have a small piece of code that behaves differently through pgpool-II
(currently development code) than through PostgreSQL 9.2:
<pre>
package pg;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class RepeatedFailures {
private static final String[] queries = {
"create table x",
"select splat from splatter",
"create table x(i int)"
};
public static void main(String[] args) throws Exception {
Class.forName("org.postgresql.Driver");
Connection conn =
DriverManager.getConnection("jdbc:postgresql://{server}/seantest",
"seantest", "seantest");
for (String query : queries) {
Statement st = conn.createStatement();
try {
st.execute(query);
System.out.println("Success: " + query);
} catch (Exception e) {
System.out.println("Ignoring: " + e);
}
}
System.out.println("Completed");
conn.close();
}
}
</pre>
The first and second statements are meant to fail in different ways, and
the last to succeed.
If {server} is a pgpool-II instance then the last query is rejected with
"current transaction is aborted, commands ignored until end of
transaction block". If it is a real PostgreSQL instance it succeeds as
one would expect. The pgpool-II server is set up in replication mode as
per http://pgpool.projects.pgfoundry.org/pgpool-II/doc/pgpool-en.html.
Note that auto-commit is default (true).
If I comment out the syntactically incorrect statement (the first one),
then the last query succeeds with both PostgreSQL and pgpool.
Is this a bug, or expected behaviour?
Thanks,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20130708/992b9175/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sean.vcf
Type: text/x-vcard
Size: 275 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20130708/992b9175/attachment.vcf>
More information about the pgpool-general
mailing list