使用OCCI删除时,将永远运行



相同的行:

DELETE(SELECT * FROM tablename WHERE id=12)

SQL开发人员正常运行,使用OCCI API会永远运行。

我已经检查了查询"从tableName中选择 *",其中ID = 12"与一组无空的行匹配。

更具体地说,我使用以下语法:

oracle::occi::Statement *deleteStm = con->createStatement("DELETE(SELECT * FROM tablename WHERE id=12)");
oracle::occi::ResultSet *rs = deleteStm->executeQuery();

我怀疑在您的情况下,您只是没有承诺的交易。这样做:

session1                   session2
DELETE ...                                        table/rows is locked
                           SELECT * FROM ...      you will see all data
                           DELETE ...             and now you will wait and wait
                                                  until lock is released
COMMIT;
                           SELECT * FROM ...      now resultset is empty

我强烈鼓励阅读数据并发和一致性

相关内容

  • 没有找到相关文章