简体   繁体   English

Postgres-强制提交到空闲事务

[英]Postgres - Force commit to idle transaction

I know it is possible to kill Postgres idle transaction, however is it possible to force it to commit. 我知道有可能杀死Postgres空闲事务,但是有可能迫使它提交。 The commit needs to come from some kind of an agent that monitors idle transactions and not from the module that started the transaction. 提交需要来自某种监视空闲事务的代理,而不是来自启动事务的模块。

Thanks Avi 谢谢阿维

There is no way to do this, and that's a good thing too. 没有办法做到这一点,这也是一件好事。 How could you be certain that the transaction's work is done and the database is in a consistent state afterwards? 您如何确定事务工作已完成并且之后数据库处于一致状态?

The correct solution is to fix the application so that it does not leave transactions “hanging”. 正确的解决方案是修复应用程序,以使其不会使事务“挂起”。

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

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