Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured

Lists: pgsql-generalpgsql-jdbc
From: David Gagnon <dgagnon(at)siunik(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: question regarding upgrade from pg74.215.jdbc3.jar to postgresql-8.1-407.jdbc3.jar. function does not exist appeared ??? Please help :-/
Date: 2006-08-22 22:15:47
Message-ID: 44EB8213.2090303@siunik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Hi,

I just upgraded my jdbc driver and fixing stuff to make it work with
the new driver. I cannot find the answer to the following one. I
tried with the old driver and everything works. With the new one that
doesn't work.

Here is the function declaration:
CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR,
VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor AS $$

Here is the error that I grabbed from the postgresql log file:

select * from usp_Comptabilite_AgeDeCompteClient(M, NULL,
2006-08-22 -0400, 1, 1, 0, NULL)

2006-08-22 18:04:27 LOG: statement: PREPARE <unnamed> AS
select * from usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4,
$5, $6, $7)
2006-08-22 18:04:27 ERROR: function
usp_comptabilite_agedecompteclient(character varying, character varying,
"unknown", boolean, boolean, character varying, "unknown") does not exist
2006-08-22 18:04:27 HINT: No function matches the given name and
argument types. You may need to add explicit type casts.
2006-08-22 18:04:27 STATEMENT: select * from
usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4, $5, $6, $7)

If I execute the statement on pgAdminIII it works: select * from
usp_Comptabilite_AgeDeCompteClient('M', NULL, '2006-08-22',
true, true, '0', NULL) ;

Any idea what is the difference between drivers that can explain this.
And of course how I can fix the problem!

Thanks for your help! It's really appreciated!
Best Regards
/David

P.S.: I traced with the debugger and I do call setDate for arg $3. I
don't understand why it's still unknow ?


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: question regarding upgrade from pg74.215.jdbc3.jar to
Date: 2006-08-22 23:47:48
Message-ID: 44EB97A4.2030308@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

David Gagnon wrote:

> CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR,
> VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor AS $$

> 2006-08-22 18:04:27 ERROR: function
> usp_comptabilite_agedecompteclient(character varying, character varying,
> "unknown", boolean, boolean, character varying, "unknown") does not exist
> 2006-08-22 18:04:27 HINT: No function matches the given name and
> argument types. You may need to add explicit type casts.

The problem is with parameter 7. This is expecting an INT, but you are
giving it a VARCHAR. You are probably calling setString(7, "0").

If you use setInt(7,0) or setObject(7,"0",Types.INTEGER) it should work.

> If I execute the statement on pgAdminIII it works: select * from
> usp_Comptabilite_AgeDeCompteClient('M', NULL, '2006-08-22',
> true, true, '0', NULL) ;

Try it in pgAdmin using PREPARE and you should see the same error.

> P.S.: I traced with the debugger and I do call setDate for arg $3. I
> don't understand why it's still unknow ?

It's because the driver doesn't know whether it is a timestamp or a
timestamptz, and if we explicitly specify a type that doesn't match the
actual type then the server will mangle the value while casting.
However, it's not that parameter which is causing your problem.

-O


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: question regarding upgrade from pg74.215.jdbc3.jar to
Date: 2006-08-22 23:51:44
Message-ID: 44EB9890.7070006@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

Oliver Jowett wrote:

> The problem is with parameter 7.

Aaaand.. I can't count. It's parameter 6 :)

-O


From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: <pgsql-general(at)postgresql(dot)org>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
Date: 2006-08-23 04:06:18
Message-ID: 8626C1B7EB748940BCDD7596134632BE39869E@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

hi,
I am using Postgres 8.0.0,
i am getting the following exception in my code, can you please suggest at to what may be going wrong?
The postgres logs do not tell anything.

thanks,
regards
Surabhi


org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:201)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:388)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:313)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:305)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.dbxTransaction(DBSession.java:1496)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installImage(DBSession.java:1254)

at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installFiles(DBSession.java:737)

at com.ge.med.terra.tap.dm.DMSession.installFiles(DMSession.java:414)

at com.ge.hc.nuevo.services.jmservice.WorkerThread.arRestore(WorkerThread.java:666)

at com.ge.hc.nuevo.services.jmservice.WorkerThread.run(WorkerThread.java:979)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.net.SocketException: Broken pipe

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)

at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)

at org.postgresql.core.PGStream.flush(PGStream.java:494)

at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:631)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:174)

... 10 more


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
Date: 2006-08-23 06:33:16
Message-ID: 44EBF6AC.1040603@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

surabhi.ahuja wrote:

> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.

> Caused by: java.net.SocketException: Broken pipe

This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.

-O


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
Date: 2006-08-24 05:56:38
Message-ID: 44ED3F96.8010700@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

surabhi.ahuja wrote:
> hi,
> dont such messages get logged to postgreslog.

You might see something in the backend logs -- "unexpected client EOF"
perhaps? Or just idle backend processes. It depends on exactly what is
going wrong, and the timing of it.

> Also, is it possible to check wht firewall is dropping the connection
> between the client and the server.

That is something you will have to diagnose yourself, it is specific to
your network.

-O


From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: "Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
Date: 2006-08-24 05:57:30
Message-ID: 8626C1B7EB748940BCDD7596134632BE3986A1@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-jdbc

hi,
dont such messages get logged to postgreslog.
Also, is it possible to check wht firewall is dropping the connection between the client and the server.

thanks,
regards
Surabhi

________________________________

From: Oliver Jowett [mailto:oliver(at)opencloud(dot)com]
Sent: Wed 8/23/2006 12:03 PM
To: surabhi.ahuja
Cc: pgsql-general(at)postgresql(dot)org; pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend

***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********

surabhi.ahuja wrote:

> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.

> Caused by: java.net.SocketException: Broken pipe

This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.

-O