2011-10-11 60 views
0

我使用postgres + hibernate + jboss final 6.0.0服務器。postgres + hibernate

當我嘗試打開數據庫連接時,它拋出以下異常:在postgresql.conf中

Caused by: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already 
2011-10-11 04:28:06,921 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:291) 
2011-10-11 04:28:06,921 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:108) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30) 
2011-10-11 04:28:06,922 ERROR [STDERR] (http-69.89.2.245-8080-11) 
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24) 
+4

是否第一消息(連接太多的客戶)提供的任何提示? – bbaja42

回答

3

檢查max_connections屬性。默認情況下它是100.如果你需要增加它。另請檢查您是否關閉了連接。

0

您已達到postgresql.conf中設置的允許客戶端的最大限制。

您應該檢查這個配置文件,並增加MAX_CONNECTIONS變量或檢查分鐘池大小最大池大小值在JBoss的數據源的聲明,並設置較低的值,以滿足Postgres配置。

0

要清除您的數據庫連接:

啓動psql的終端:

SELECT pg_terminate_backend(pg_stat_activity.procpid) 
FROM pg_stat_activity 
WHERE pg_stat_activity.datname = 'YOUR_DATABASE_NAME'; 
相關問題