假设我有:
untimedStatement = connection.createStatement() ;
timedStatement = connection.createStatement();
然后运行
timedStatement.execute("SET statement_timeout TO " + timeout);
SET statements_timeout 命令也会影响 untimedStatement 吗?我希望不会,但我观察到的一些行为表明 SET statements_timeout 具有“普遍”效果(至少在程序的生命周期内)
最佳答案
是的,只要它们在同一连接上执行即可。
您可以使用 SET LOCAL statements_timeout 使其仅影响当前事务。 Details .
关于postgresql - JDBC postgres statements_timeout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1181490/