postgresql 事务

https://blog.csdn.net/weixin_41790552/article/details/90443762

查看进程 
 ps -ef|grep postgres
postgres 1511156 1448507  0 18:18 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4528) idle
postgres 1511157 1448507  0 18:18 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4549) idle
postgres 1511158 1448507  0 18:18 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4128) idle
postgres 1511159 1448507  0 18:18 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4181) idle
postgres 1511458 1448507  0 18:46 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4188) idle in transaction
postgres 1511459 1448507  0 18:46 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4200) idle
postgres 1511541 1448507  0 18:51 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4118) idle
postgres 1511547 1448507  0 18:51 ?        00:00:00 postgres: iming bx_dtsrv_app 112.39.103.57(4119) idle

//idle in transaction 表示 事务中,但未提交,如果有其它线程执行相关表,可能会产生锁。 

杀列进程


select pg_terminate_backend(进程id);

以上idle in transaction ,是由于dbeaver 默认开启了事务,dbeaver 上相关数据操作,java程序上再执行相关数据的 update ,可能会产生锁。

dbeaver 不启用事务


image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容