postgres +休眠

发布于 2024-12-09 07:58:40 字数 1480 浏览 0 评论 0原文

我正在使用 postgres + hibernate + jboss Final 6.0.0 服务器。

当我尝试打开数据库连接时,它抛出以下异常:

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)

I am using postgres + hibernate + jboss final 6.0.0 server.

When I try to open the database connection, it throws the following exception:

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

只是我以为 2024-12-16 07:58:40

检查 postgresql.conf 中的 max_connections 属性。默认情况下为 100。如果需要,请增加它。另请检查您是否关闭了连接。

Check max_connections property in postgresql.conf. By default it's 100. Increase it if you need. Also check that you close your connections.

踏雪无痕 2024-12-16 07:58:40

您已达到 postgresql.conf 中设置的允许客户端的最大限制。

您应该检查此配置文件,并增加 ma​​x_connections 变量或检查您的 min-pool-sizema​​x-pool-size 值JBoss 数据源声明,并设置较低的值以满足 Postgres 配置。

You have hit the maximum limit of allowed clients set in postgresql.conf.

You should check this configuration file, and increase the max_connections variable or check the min-pool-size and max-pool-size values at your JBoss datasource declaration, and set lower values to meet the Postgres configuration.

娇俏 2024-12-16 07:58:40

要清除数据库连接:

启动 psql 终端并:

SELECT pg_terminate_backend(pg_stat_activity.procpid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'YOUR_DATABASE_NAME';

To clear your database connections:

Start a psql terminal and:

SELECT pg_terminate_backend(pg_stat_activity.procpid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'YOUR_DATABASE_NAME';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文