Weird connection problems with SQLExceptions being thrown - Mailing list pgsql-jdbc

From Christian Cabanero
Subject Weird connection problems with SQLExceptions being thrown
Date
Msg-id 000001c1d205$e8064900$e000a8c0@thematrix
Whole thread Raw
Responses Re: Weird connection problems with SQLExceptions being thrown
List pgsql-jdbc
I've observed some weird behavior when SQLExceptions are thrown when they
are SQL-related exceptions (i.e., referential integrity violations or
unique-index violations) and NOT non-connection problems (i.e. loosing a
network).  What seems to happen is that if I have a connection and in the
course of executing several insert/update statements and several of them
throw SQLExceptions that are a combination of referential integrity
violations, after about 4 SQLExceptions I get a weird error:

Root Cause:
No results were returned by the query.
        at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:58)
        at
alatron.db.SQLRunnerPostgresqlImpl.getSequenceNextVal(SQLRunnerPostgresqlImp
l.java:149)
        at
alatron.db.SQLRunnerPostgresqlImpl.executeInsert(SQLRunnerPostgresqlImpl.jav
a:84)

yadda yadda yadda.

From that point forward I can't use the connection object to perform ANY SQL
Statements.  For example, this error comes up when trying to run a normal
SELECT statement which definitely works afterward in just a psql session.
The key thing is that after 2 or 3 SQL Exceptions I can still perform
updates and inserts but after on the 4th one it starts returning this error.
This seems very strange as a SQL-related exception I believe should not hose
up a connection.

I've also tried explicitly setting autoCommit(true) on the Connection object
but that doesn't seem to help.  Is this a known problem with the JDBC
driver?


Thanks,
Christian Cabanero


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: Re: JDBC Logging & log4j
Next
From: "Dave Cramer"
Date:
Subject: Re: Weird connection problems with SQLExceptions being thrown