Re: Loosing connection with the database - Mailing list pgsql-general

From Poul Møller Hansen
Subject Re: Loosing connection with the database
Date
Msg-id 425B8599.5050707@pbnet.dk
Whole thread Raw
In response to Re: Loosing connection with the database  (Kris Jurka <books@ejurka.com>)
Responses Re: Loosing connection with the database  (Kris Jurka <books@ejurka.com>)
List 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

pgsql-general by date:

Previous
From: Clifton Zama
Date:
Subject: Connection closing
Next
From: Oleg Bartunov
Date:
Subject: Re: Log File Maintainance