删除查询无法在Java应用程序中正常工作 [英] Delete query is not working form java application

查看:169
本文介绍了删除查询无法在Java应用程序中正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含4列c1, c2, c3, c4的表. c1c2构成表的主键.

I have a table with 4 columns c1, c2, c3, c4. c1 and c2 form the primary key of the table.

当我在Java中运行以下命令时,它会挂在我的应用程序中.

When I run the following in Java then it hangs in my application.

DELETE from mytable 
 where c1 = 'val' 
   and c2 = 'val2'

但是,相同的查询在Oracle DB控制台中运行也很好.当我运行DELETE from mytable where c3 = 'val'时,它在我的应用程序中运行正常.

However, the same query runs in the Oracle DB console perfectly fine. When I run DELETE from mytable where c3 = 'val' it works perfectly fine from my application.

可能是什么原因?

推荐答案

也许只有一个Oracle会话阻止了另一个会话.在这种情况下,控制台"会话将阻止Java应用程序会话. 尝试在"Oracle DB控制台"会话中提交.

Maybe just one Oracle session blocks another. In this case "console" session block Java app session. Try to COMMIT in your "Oracle DB console" session.

当您从一个会话中删除一些行而不提交时,然后尝试从另一个会话(Java应用程序)中删除相同的行时,它将挂起,直到第一个会话提交(或回滚)为止.

When you delete some rows from one session without commiting and then try to delete the same rows from another session (Java app) it will hang until first session commits (or rollbacks).

这篇关于删除查询无法在Java应用程序中正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆