views:

188

answers:

3

hi im using postgresql database, I want to insert my datas into database,but whenever i run the server,it was display the following Error.

Error:org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

How to solve this problem.My server.properties file is following.

Sever.properties File:

serverPortData=9042
serverPortCommand=9078
trackConnectionURL=jdbc:postgresql://127.0.0.1:5432/vTrack?user=postgres password=postgres
dst=1
DatabaseName=vTrack
ServerName=127.0.0.1
User=postgres
Password=admin
MaxConnections=90
InitialConnections=80
PoolSize=100
MaxPoolSize=100
KeepAliveTime=100
TrackPoolSize=120
TrackMaxPoolSize=120
TrackKeepAliveTime=100
PortNumber=5432
Logging=1

Thanks.

A: 

The offending lines are the following:

MaxConnections=90
InitialConnections=80

You can increase the values to allow more connections.

Delan Azabani
And if you will be having more connections allowed adjust memory parameters as well to align with increased connections.
StarShip3000
A: 
  1. restart your postgre server
  2. make sure you call connection.close() whenever you finish working with it.
Bozho
+1  A: 

We don't know what server.properties file is that, we neither know what SimocoPoolSize means (do you?)

Let's guess you are using some custom pool of database connections. Then, I guess the problem is that your pool is configured to open 100 or 120 connections, but you Postgresql server is configured to accept MaxConnections=90 . These seem conflictive settings. Try increasing MaxConnections=120.

But you should first understand your db layer infrastructure, know what pool are you using, if you really need so many open connections in the pool. And, specially, if you are gracefully returning the opened connections to the pool

leonbloy