简体   繁体   English

同一连接上的 PostgreSQL 多个事务

[英]PostgreSQL multiple transactions on the same connection

Does PostgreSQL support multiple transactions on the same connection? PostgreSQL 是否支持同一连接上的多个事务? I don't mean nested transactions, but unrelated different transactions.我不是说嵌套交易,而是不相关的不同交易。

If you mean "interleaved transactions" as required by the Java JTA standard: No, there is no support for that.如果您指的是 Java JTA 标准要求的“交错事务”:不,不支持它。 See this JDBC FAQ section for this and why it is not a big loss.请参阅此JDBC FAQ 部分了解这一点以及为什么损失不大。

Also the PostgreSQL core does not support something like this. PostgreSQL 核心也不支持这样的东西。

If with unrelated you mean one after the other, then the answer is yes.如果与无关你的意思是一个接一个,那么答案是肯定的。

If you mean having different transactions open at the same time, then the answer is no (there are some hacks available using dblink but I don't think they qualify as "on the same connection).如果您的意思是同时打开不同的事务,那么答案是否定的(使用 dblink 可以使用一些 hack,但我认为它们不符合“在同一连接上”的条件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM