SQL7008 错误 - 解决方法?

2022-01-14 00:00:00 sql db2 ibm-midrange jdbc java

我正在将 JTOpen JDBC 驱动程序用于 DB2 通用数据库.除了简单的语句之外,我对 SQL 的经验很少.

I'm using the JTOpen JDBC driver for a DB2 Universal database. I have very little experience with SQL beyond simple statements.

从 这个问题,我看到尝试在事务期间在非日志表中插入/更新行"时抛出我遇到的错误(SQL7008)(释义).

From this question, I see that the error I'm getting (SQL7008) is thrown when trying to "insert/update rows in a non-journaled table during a transaction" (paraphrased).

根据项目负责人的说法,我们的 DB 没有日志记录,并且不会很快出现(不要问我为什么,我不是 DBA).但是,我正在开发一个项目,其中几乎需要一次性commit 所有内容(而不是每次调用执行时都自动提交)(不是完全需要,但它会解决未来会有很多问题).

According to the project lead, our DB is not journaled and won't be any time soon (don't ask me why, I'm not the DBA). However, I'm working on a project where being able to commit everything in one go (rather than AutoCommit-ing each time an execute is called) is nearly necessary (not totally required, but it would solve a lot of issues down the road).

有没有办法在不启用 Journalling 的情况下解决错误 SQL7008?

Is there any way to work around erorr SQL7008 without enabling Journalling?

推荐答案

在不启用日志的情况下解决此问题的唯一方法是在连接字符串中禁用 事务隔离,如下所示:

The only way to work around it without enabling journaling is to disable transaction isolation in your connection string as follows:

jdbc:as400://systemname;naming=sql;errors=full;transaction isolation=none;date format=iso

可以在 IBM Toolbox for Java JDBC 属性 文档.

相关文章