insufficient data left in message II

From: Robert Wimmer <seppwimmer(at)hotmail(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: insufficient data left in message II
Date: 2008-04-29 10:26:40
Message-ID: BAY139-W2743EB558BBD1A44F37B36D0D90@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


> Date: Tue, 29 Apr 2008 16:37:03 +1200
> From: oliver(at)opencloud(dot)com
> To: seppwimmer(at)hotmail(dot)com
> CC: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] ERROR: insufficient data left in message
>
> Robert Wimmer wrote:
> > I always get the error 'insufficient data left in message' running a
> > prepared statement via jdbc executeQuery
>
ican locate the problem better now. the prepared insert statement is NOTthe origin cause. if the following lines are commented out no errorwill occur only SOMETIMES and the insert and the update statement willwork as expected.

***
// should not be found
//if (proxy.get(person,new Long(45678)))
// System.out.println('found : ' + person.toString()); <<<< here is the problem
// else System.out.println('not found : ' + person.toString());
**** and now the rest works fine
// update
person.setFirstName('Homero');
if (proxy.update(person)) System.out.println('updated : ' + person.toString());
else System.out.println('not updated : ' + person.toString());
// insert a new one
Person person2 = new Person();
person2.setFirstName('Ropert');
person2.setLastName('Wimmer');
person2.setReadOnly(false);
person2.setBirthDay(null);
if (proxy.insert(person2)) System.out.println('inserted : ' + person2.toString());
else System.out.println('inserted : ' + person2.toString());
}
**** output
updated : [1] Simpson, Homero (readOnly=false, private=)
inserted : [null] Wimmer, Ropert (readOnly=false, private=)
done
****

thestrange thing is if I run the program above from the command line theresult depends on what happend during the last call of the program. soif i change the program in the IDE in a way that an error will occurthe sam error will also occur from the commandline for the next 2 or 3times - afterwards it will work as expected.

my suspicion is, that if the get statement returns nothing this error will occur.
***
ResultSet rs = this.getStatement.executeQuery();
if (rs.first()) { readResultSet(rs,data); ret = true; }
rs.close();
// getStatement = 'SELECT * FROM person.person WHERE id = ?'
***
butthe error only will occur if I run an insert or update statementafterwards. I.E. if i only do not find no error will occur but if iupdate or insert afterwards this error will occur ! and vice versa - aslong as there is no NOT FOUND the insert & update statement willwork.

if a reproduce this situation (not finding data) i get the following log entries
***
2008-04-29 12:14:54 CEST LOG: unexpected EOF on client connection
2008-04-29 12:14:58 CEST LOG: could not receive data from client: Connection reset by peer
2008-04-29 12:14:58 CEST LOG: unexpected EOF on client connection
2008-04-29 12:15:01 CEST LOG: could not receive data from client: Connection reset by peer
2008-04-29 12:15:01 CEST LOG: unexpected EOF on client connection
2008-04-29 12:15:06 CEST LOG: could not receive data from client: Connection reset by peer
2008-04-29 12:15:06 CEST LOG: unexpected EOF on client connection
2008-04-29 12:15:13 CEST LOG: could not receive data from client: Connection reset by peer
2008-04-29 12:15:13 CEST LOG: unexpected EOF on client connection
2008-04-29 12:15:22 CEST LOG: could not receive data from client: Connection reset by peer
2008-04-29 12:15:22 CEST LOG: unexpected EOF on client connection
***
the 'unexpected EOF ...' is very suspicous to me.

any ideas ?

regards sepp
_________________________________________________________________
Der Messenger plaudert gerne - egal ob zu zweit oder mit allen gemeinsam. Willkommen in der Familie! Den neuen Windows Live Messenger jetzt herunterladen!
http://get.live.com/messenger/overview/

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2008-04-29 11:34:55 Re: insufficient data left in message II
Previous Message Robert Wimmer 2008-04-29 06:41:05 Re: ERROR: insufficient data left in message