Weird connection problems with SQLExceptions being thrown

Поиск
Список
Период
Сортировка
Искать

Weird connection problems with SQLExceptions being thrown

От:
"Christian Cabanero" <chumpboy@yahoo.com>
Дата:
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

Re: Weird connection problems with SQLExceptions being thrown

От:
"Dave Cramer" <Dave@micro-automation.net>
Дата:
Christian,

The latest development driver on the site should take care of this
problem.

It is a known problem with the 7.2 driver

Dave 

> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org 
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of 
> Christian Cabanero
> Sent: Friday, March 22, 2002 7:59 PM
> To: pgsql-jdbc@postgresql.org
> Cc: hphan@alatron.com
> Subject: [JDBC] Weird connection problems with SQLExceptions 
> being thrown
> 
> 
> 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(SQLRunne
> rPostgresqlImp
> l.java:149)
>         at 
> alatron.db.SQLRunnerPostgresqlImpl.executeInsert(SQLRunnerPost
> gresqlImpl.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
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an 
> appropriate subscribe-nomail command to 
> majordomo@postgresql.org so that your message can get through 
> to the mailing list cleanly
> 
> 

FAQ