【问题标题】:PgBouncer transaction mode does not support prepared-statements even with prepareThreshold=0即使prepareThreshold=0,PgBouncer 事务模式也不支持prepared-statements
【发布时间】:2020-02-20 11:00:26
【问题描述】:

我在“事务”模式下使用 PgBouncer 进行连接池。我们的代码已经在多个地方使用了 PreparedStatements。 尽管 PgBouncer https://www.pgbouncer.org/faq.html#how-to-use-prepared-statements-with-transaction-pooling 上的常见问题解答建议使用 prepareThreshold=0 来禁用preparedStatements,但实际上这不起作用。 有什么解决办法吗?

【问题讨论】:

    标签: pgbouncer


    【解决方案1】:

    这是一个老问题,但我将回答它以供参考。

    尝试将 preparedStatementCacheQueries=0 也添加到您的 JDBC 连接字符串中。

    e.g. jdbc:postgresql://{0}:{1}/{2}?user={3}&password={4}&prepareThreshold=0&preparedStatementCacheQueries=0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-23
      • 2013-08-25
      • 2016-04-08
      • 2021-02-04
      • 2016-10-25
      • 1970-01-01
      • 2013-05-05
      相关资源
      最近更新 更多