当前位置: 移动技术网 > IT编程>数据库>MSSQL > jdbcpstmt.executeQuery()程序中断引起的问题(数据库postgrelsql)

jdbcpstmt.executeQuery()程序中断引起的问题(数据库postgrelsql)

2018年03月11日  | 移动技术网IT编程  | 我要评论

侯门女 秋李子,反恐特警组下载,南京pm2.5

jdbcpstmt.executeQuery()程序中断引起的问题(数据库postgrelsql)

问题现象:

代码执行pstmt.executeQuery()程序中断,没有排除任何异常信息。

原因:execute操作对应的数据库表被锁。

postgrelsql查看表被锁方法:

第一步:查看表锁

select a.locktype,a.database,a.pid,a.mode,a.relation,b.relname

from pg_locks a

join pg_class b on a.relation = b.oid

where upper(b.relname) like '%大写表名%';

第二步:根据pid查询产生锁的sql语句

select * from pg_stat_activity t where t.pid = 10308 or t.pid = 6828;

如有需要可以在db服务器上用ps -ef|grep pid查看进程,或者用kill pid杀死进程。

参考文章:https://www.linuxidc.com/Linux/2015-11/125329.htm

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网