在什么情况下,sql 更新语句会返回没有更新行的情况?
在我的应用程序中,我们使用以下代码
if (m_ps.executeUpdate() != 1) {
{
throw new ConcurrentDBModificationException();
}
}
}
我们正在更新的表肯定存在。
该表还有一个时间戳列,可以正确填充。
它只是发生在一些我无法调试的客户环境上。
任何帮助将非常感激。
感谢您的阅读
In my application we are using the following code
if (m_ps.executeUpdate() != 1) {
{
throw new ConcurrentDBModificationException();
}
}
}
The table we are updating is present for sure.
Also the table has a timestamp colomn which gets filled up correctly.
It just happens on some customers environment which i cannot debug.
Any help would be very much appreciated.
Thanks for reading
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是 sql 更新语句将返回的情况,因为没有更新行:
UPDATEEmployees SETsalary = 14 WHEREage > > 40
...基本上是当 WHERE 子句没有返回行时。
编辑
考虑到“抛出ConcurrentDBModificationException()”,这可能是在用户使用您的应用程序编辑信息时已从表中删除编辑的行的情况...
The following is case where an sql update statement will return as no rows updated :
UPDATE employees SET salary = 14 WHERE age > 40
...basically when there are no rows that are returned by the WHERE clause.
EDIT
Considering the "throw ConcurrentDBModificationException()", this is probably in the case where the edited row has been deleted from the table while the user was using your application to edit the information...