Re: Loosing connection with the database

From: Poul Møller Hansen <freebsd(at)pbnet(dot)dk>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Poul Møller Hansen <freebsd(at)pbnet(dot)dk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Loosing connection with the database
Date: 2005-04-12 08:23:53
Message-ID: 425B8599.5050707@pbnet.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>>>This sort of thing has been seen to occur when multiple client-side
>>>threads try to use the same database connection without proper locking
>>>to ensure only one thread uses it at a time. See for example
>>>http://archives.postgresql.org/pgsql-hackers/2004-09/msg00104.php
>>>
>>>
>>>
>>This is exactly what I am doing. Must admit I haven't considered that as
>>an issue. For performance reasons I suppose one database connection per
>>client are preferred rather than using synchronized on the db class ?
>>
>>
>>
>
>The JDBC driver should be doing any synchronization necessary for multiple
>threads. Could you be more clear what you are doing? What driver
>version? Any chance you've got a reproducible example?
>
>Kris Jurka
>
>
I have rewritten the application so every client thread is opening a new
database connection, and yesterday it happened again.
---
2005-04-11 12:27:54 ERROR: invalid string enlargement request size
1358954492
2005-04-11 12:27:54 WARNING: AbortTransaction and not in in-progress
state
2005-04-11 12:27:54 FATAL: invalid frontend message type
78
---
The application is opening a socket listener, and every client
connection opens a new connection to the database.
The clients sends a status message every 2nd minute that are written to
the database.
I'm using Postgresql version 7.4.7 and jdbc driver version
pg74.215.jdbc3.jar.
I have tried the pg80.310.jdbc3.jar but the datatype inet can't be used
with setString ??

Do you have a clue on what's going on ?

Poul

I found this: http://jdbc.postgresql.org/documentation/80/thread.html
As you are saying the jdbc driver should be thread safe, and has been
since the first version.
The

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2005-04-12 08:43:49 Re: Log File Maintainance
Previous Message Richard Huxton 2005-04-12 07:51:24 Re: Log File Maintainance