首页 > 数据库技术 > 详细

Postgresql:prepared statement "S_1" already exists

时间:2016-11-05 20:18:39      阅读:2015      评论:0      收藏:0      [点我收藏+]

近期由于业务需要和一些json的存储查询需要,把新的应用切到pgsql上来,刚刚切好,是可以正常使用的,但是偶尔会来一下

java连接pgsql 偶尔出现 这个错。
 
org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists 
 
检查sql语句,几乎没问题,又看设置,实在找不到哪里有问题
 
百度网上的资料太少了,干脆我写一篇,方便以后遇到此问题的朋友 解决问题,不用翻来覆去找了
 
经过仔细查阅pgbouncer官方文档 
找到了方法
 

Disabling prepared statements in JDBC

The proper way to do it for JDBC is adding prepareThreshold=0 parameter to connect string.

 在配置文件上加上

jdbc.url=jdbc:postgresql://xxxxx:6432/finance_log?prepareThreshold=0

再次启动,S_1这样的错误几乎找不到了。OK

附官方说明
https://pgbouncer.github.io/faq.html#what-should-my-serverresetquery-be

https://jdbc.postgresql.org/documentation/head/connect.html

Postgresql:prepared statement "S_1" already exists

原文:http://www.cnblogs.com/fangyuan303687320/p/6033526.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!