pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedcalling java stored functions through jdbc gives errors.
7+ messages / 3 participants
[nested] [flat]
* calling java stored functions through jdbc gives errors.
@ 2006-11-02 07:54 Alex Stienstra <alex.stienstra@zonnet.nl>
0 siblings, 1 reply; 7+ messages in thread
From: Alex Stienstra @ 2006-11-02 07:54 UTC (permalink / raw)
To: pgsql-jdbc
The following simple query I send to the server using JDBC:
"SELECT uw_ping()"
When the stored function uw_ping() is written in 'plpgsql' everything
works fine. But when the uw_ping() is written in java and linked in
using PL/java it gives the following error message:
org.postgresql.util.PSQLException: An I/O error occured while sending
to the backend.
Executing the same query using pgadmin III gives no problems. Anyone
any idea what the problem is?
Best regards,
Alex Stienstra.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives errors.
@ 2006-11-02 09:57 Markus Schaber <schabi@logix-tt.com>
parent: Alex Stienstra <alex.stienstra@zonnet.nl>
0 siblings, 1 reply; 7+ messages in thread
From: Markus Schaber @ 2006-11-02 09:57 UTC (permalink / raw)
To: Alex Stienstra <alex.stienstra@zonnet.nl>; +Cc: pgsql-jdbc
Hi, Alex,
Alex Stienstra wrote:
> The following simple query I send to the server using JDBC:
>
> "SELECT uw_ping()"
>
> When the stored function uw_ping() is written in 'plpgsql' everything
> works fine. But when the uw_ping() is written in java and linked in
> using PL/java it gives the following error message:
>
> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.
>
> Executing the same query using pgadmin III gives no problems. Anyone any
> idea what the problem is?
It might be a V2/V3 protocol difference.
Do you get the error message immediately, or after a short timeout?
Can you look into the server logs to see what's noted there?
Thanks,
markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives errors.
@ 2006-11-02 10:44 Dave Cramer <pg@fastcrypt.com>
parent: Markus Schaber <schabi@logix-tt.com>
0 siblings, 1 reply; 7+ messages in thread
From: Dave Cramer @ 2006-11-02 10:44 UTC (permalink / raw)
To: Markus Schaber <schabi@logix-tt.com>; +Cc: Alex Stienstra <alex.stienstra@zonnet.nl>; pgsql-jdbc
Alex,
Also try preparing the call in psql
prepare foo_plan as select uw_ping();
execute foo_plan;
However I can tell you that jdbc doesn't do anything particularly
different than psql or pgadmin.
Dave
On 2-Nov-06, at 4:57 AM, Markus Schaber wrote:
> Hi, Alex,
>
> Alex Stienstra wrote:
>> The following simple query I send to the server using JDBC:
>>
>> "SELECT uw_ping()"
>>
>> When the stored function uw_ping() is written in 'plpgsql' everything
>> works fine. But when the uw_ping() is written in java and linked in
>> using PL/java it gives the following error message:
>>
>> org.postgresql.util.PSQLException: An I/O error occured while
>> sending to
>> the backend.
>>
>> Executing the same query using pgadmin III gives no problems.
>> Anyone any
>> idea what the problem is?
>
> It might be a V2/V3 protocol difference.
>
> Do you get the error message immediately, or after a short timeout?
>
> Can you look into the server logs to see what's noted there?
>
> Thanks,
> markus
>
>
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf. | Software Development GIS
>
> Fight against software patents in Europe! www.ffii.org
> www.nosoftwarepatents.org
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives errors.
@ 2006-11-02 12:06 Markus Schaber <schabi@logix-tt.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 7+ messages in thread
From: Markus Schaber @ 2006-11-02 12:06 UTC (permalink / raw)
To: pgsql-jdbc
Hi, Dave,
Dave Cramer wrote:
> However I can tell you that jdbc doesn't do anything particularly
> different than psql or pgadmin.
It uses the V3 protocol, and AFAIK it uses protocol-level prepare
instead of PREPARE queries.
Regards,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives errors.
@ 2006-11-02 13:14 Dave Cramer <pg@fastcrypt.com>
parent: Markus Schaber <schabi@logix-tt.com>
0 siblings, 1 reply; 7+ messages in thread
From: Dave Cramer @ 2006-11-02 13:14 UTC (permalink / raw)
To: Markus Schaber <schabi@logix-tt.com>; +Cc: pgsql-jdbc
On 2-Nov-06, at 7:06 AM, Markus Schaber wrote:
> Hi, Dave,
>
> Dave Cramer wrote:
>
>> However I can tell you that jdbc doesn't do anything particularly
>> different than psql or pgadmin.
>
> It uses the V3 protocol, and AFAIK it uses protocol-level prepare
> instead of PREPARE queries.
True enough, try adding protocolVersion=2 to the url and it will use
v2 protocol
>
> Regards,
> Markus
>
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf. | Software Development GIS
>
> Fight against software patents in Europe! www.ffii.org
> www.nosoftwarepatents.org
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives
@ 2006-11-02 14:55 Alex Stienstra <alex.stienstra@zonnet.nl>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 7+ messages in thread
From: Alex Stienstra @ 2006-11-02 14:55 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Hi Dave,
Thanks for the advice.
I added the protocolVersion=2 option and now it works better. That is
to say that every other session is works oke. If not oke it still
produces:
"An I/O error occured while sending to the backend."
Within one session I open a jdbc connection and issue a number of
SELECTS with the java function call inside. Any ideas?
Best regards,
Alex
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: calling java stored functions through jdbc gives errors.
@ 2006-11-02 15:14 Dave Cramer <pg@fastcrypt.com>
parent: Alex Stienstra <alex.stienstra@zonnet.nl>
0 siblings, 0 replies; 7+ messages in thread
From: Dave Cramer @ 2006-11-02 15:14 UTC (permalink / raw)
To: Alex Stienstra <alex.stienstra@zonnet.nl>; +Cc: pgsql-jdbc
Alex,
Can you get the server logs ? Just the relevant ones before this error ?
Dave
On 2-Nov-06, at 9:55 AM, Alex Stienstra wrote:
> Hi Dave,
>
> Thanks for the advice.
>
> I added the protocolVersion=2 option and now it works better. That
> is to say that every other session is works oke. If not oke it
> still produces:
> "An I/O error occured while sending to the backend."
> Within one session I open a jdbc connection and issue a number of
> SELECTS with the java function call inside. Any ideas?
>
> Best regards,
>
> Alex
>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2006-11-02 15:14 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-02 07:54 calling java stored functions through jdbc gives errors. Alex Stienstra <alex.stienstra@zonnet.nl>
2006-11-02 09:57 ` Markus Schaber <schabi@logix-tt.com>
2006-11-02 10:44 ` Dave Cramer <pg@fastcrypt.com>
2006-11-02 12:06 ` Markus Schaber <schabi@logix-tt.com>
2006-11-02 13:14 ` Dave Cramer <pg@fastcrypt.com>
2006-11-02 14:55 ` Re: calling java stored functions through jdbc gives Alex Stienstra <alex.stienstra@zonnet.nl>
2006-11-02 15:14 ` Dave Cramer <pg@fastcrypt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox