Home  >  Article  >  Database  >  关于Oracle 数据库update 卡死的问题

关于Oracle 数据库update 卡死的问题

WBOY
WBOYOriginal
2016-06-07 17:00:541899browse

今天做eclipse项目的小修改,发现以前可以运行的项目部分今天总是卡死,开始以为是数据库没有关闭连接,导致连接堵塞,后来仔细一

今天做eclipse项目的小修改,,发现以前可以运行的项目部分今天总是卡死,开始以为是数据库没有关闭连接,导致连接堵塞,后来仔细一看每个都有关闭链接。下断点调试发现是在update的时候出问题,程序卡死在update上面。我用plsql在数据库中查询同样是卡死状态,换一条数据能够正常执行。google了一下找到问题出现的原因。

由于在执行update的时候,当程序已经执行了executeupdate 但是还没有提交事务 commit ,Oracle自动锁住该条记录。

解决方法如下。

查询出被锁的数据的sid和serial# 字段。

然后删除掉系统锁定的此记录

如果有多个sid 和serial# 重复删除每条记录。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn