0

I am running my application through JBoss with postgresql database but giving me max connection error but through PGAdmin I am able to connect database

17:14:44,917 ERROR [STDERR] [WARNING] com.mchange.v2.resourcepool.BasicResourceP ool$AcquireTask@52900718 -- Acquisition Attempt Failed!!! Clearing pending acqui res. While trying to acquire a needed new resource, we failed to succeed more th an the maximum number of allowed acquisition attempts (2). Last acquisition atte mpt exception: org.postgresql.util.PSQLException: FATAL: remaining connection sl ots are reserved for non-replication superuser connections at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(Conn

Lina
  • 305
  • 1
  • 6
  • 15
  • 1
    Somewhere you are not closing connections properly. –  Apr 19 '19 at 12:28
  • it is giving me this error immediately after starting JBoss . I checked the pid of postgre so it showing more than 500 connection how can i kill pid from pgadmin. I am not able to use command prompt becuase I am setting my application on aws – Lina Apr 19 '19 at 12:40
  • so you have mis-configured your connection pool to open too many connections on startup. –  Apr 19 '19 at 12:40
  • You can cancel sessions using `pg_terminate_backend`. You seem to have a connection leak somewhere in your code. – Laurenz Albe Apr 19 '19 at 13:04
  • how can i use pg_terminate_backend please tell me exact procedure i am new for it – Lina Apr 19 '19 at 13:28

1 Answers1

0

Try to open file:

/etc/postgres/postgresql.conf

And increase number off connections like:

max_connections = 100 
stakahop
  • 921
  • 9
  • 18