Menu

#392 XC error in prepare after iteration in JDBC

V1.0 maintenance
open
8
2014-06-11
2013-02-12
No

When prepare statement is iterated, XC application gets an error message that ERROR: prepared statement "xxxx" already exists.

It is not successful to reproduce the problem from psql so materials are attached to reproduce it from JDBC.

Typical output from the test script is as follows:

------8<--------------------------8<------------
[koichi@linker:test124]$ test124.sh node01 20004 koichi
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.6) (rhel-1.33.1.11.6.el5_9-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
javac 1.6.0_24
JDBC DRIVER = postgresql-9.1-902.jdbc4.jar
DROP DATABASE
CREATE DATABASE
CREATE TABLE
CREATE TABLE
start...[ c3 = 1 ]
loop = 0 ...complete
loop = 1 ...complete
loop = 2 ...complete
loop = 3 ...complete
loop = 4 ...complete
loop = 5 ...complete
loop = 6 ...complete
loop = 7 ...complete
loop = 8 ...complete
loop = 9 ...complete
complete [ c3 = 1 ]
start...[ c3 = 2 ]
loop = 0 ...complete
loop = 1 ...complete
loop = 2 ...complete
loop = 3 ...complete
loop = 4 ...
[ERROR] catch SQLException
org.postgresql.util.PSQLException: ERROR: prepared statement "S_4" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2101)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1834)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:386)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:332)
at Test124.main(Test124.java:99)
[koichi@linker:test124]$
------>8-------------------------->8------------

Discussion

  • Koichi Suzuki

    Koichi Suzuki - 2013-02-12

    Found the file is greater than sourceforge's upper limit. Please contact me if you need the material.

     
  • Koichi Suzuki

    Koichi Suzuki - 2014-06-11

    This happens because JDBC switches to binary mode but XC does not support it. Workaround is to prevent JDBC to switch to binary mode.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.