gpt4 book ai didi

postgresql - JDBC postgres statement_timeout

转载 作者:行者123 更新时间:2023-11-29 12:06:57 27 4
gpt4 key购买 nike

假设我有:

untimedStatement = connection.createStatement() ;
timedStatement = connection.createStatement();

然后运行

timedStatement.execute("SET statement_timeout TO " + timeout);

SET statement_timeout 命令是否也会影响 untimedStatement?我希望它不会,但我观察到的一些行为表明 SET statement_timeout 具有“普遍”效果(至少在程序的生命周期内)

最佳答案

是的,只要它们在同一个连接上执行。

您可以使用 SET LOCAL statement_timeout 使其只影响当前事务。 Details .

关于postgresql - JDBC postgres statement_timeout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1181490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com