首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用JPA查询注释更新Oracle 11g查询挂起

使用JPA查询注释更新Oracle 11g查询挂起
EN

Stack Overflow用户
提问于 2018-02-02 22:17:01
回答 1查看 704关注 0票数 1

我正在尝试使用Query Annotation with JPA将简单的行更新到Oracle 11g

这是我的代码:

代码语言:javascript
复制
@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中不起作用?

非常感谢您能提供的任何帮助。

EN

回答 1

Stack Overflow用户

发布于 2018-02-02 22:36:14

您可以使用该查询查找锁(作为sysdba运行)

代码语言:javascript
复制
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;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48584588

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档