我正在尝试使用Query Annotation with JPA将简单的行更新到Oracle 11g
这是我的代码:
@Transactional()
@Modifying
@Query(value="UPDATE Irregularities SET IRREST_ID = 0 WHERE IRREGS_ID = 1006", nativeQuery = true)
int updateState();它工作得很好,但由于某种原因,它不再工作。没有错误,只是挂起了。
如果我尝试在相同的BDD中使用Oracle SQL Developer运行相同的查询,则工作正常。
可能是锁表问题?为什么在SQL Developer中工作,而在Springboot中不起作用?
非常感谢您能提供的任何帮助。
发布于 2018-02-02 22:36:14
您可以使用该查询查找锁(作为sysdba运行)
select
(select username || ' - ' || osuser || ' - ' || machine from v$session where sid=a.sid) blocker,
a.sid || ', ' ||
(select serial# from v$session where sid=a.sid) sid_serial,
' is blocking ',
(select username || ' - ' || osuser || ' - ' || machine from v$session where sid=b.sid) blockee,
b.sid || ', ' ||
(select serial# from v$session where sid=b.sid) sid_serial
from v$lock a, v$lock b
where a.block = 1
and b.request > 0
and a.id1 = b.id1
and a.id2 = b.id2;https://stackoverflow.com/questions/48584588
复制相似问题