Error SQL7008 while updating a DB2 for iSeries table(更新 DB2 for iSeries 表时出错 SQL7008)
问题描述
我有一个使用 Hibernate 和 DB2 for iSeries
的 Java Web 应用程序,在更新表期间我收到以下错误:-
I have a Java Web application using Hibernate and DB2 for iSeries
and during update of a table I get he following error:-
更新 DB2 时出错 SQL7008iSeries 表
Error SQL7008 while updating a DB2 for iSeries table
推荐答案
通过对该错误消息进行一些谷歌搜索,我注意到当您在非事务模式下运行插入/更新时会发生这种情况.这里给出了解释.
From doing some googling on this error message I noticed that it happens when you are running an insert/update in a non-transactional mode. The explanation is given here.
发生这种情况是因为您所在的表试图更新不是已记录,您的更新正在在事务中运行.
This occurs because the table you are trying to update is not being journalled, and your update is being run within a transaction.
通常,您应该始终提交(并在发生异常时回滚)您的事务.通常我从不将自动提交设置为 true,但在这种情况下,我想了解它是否真的需要,如上面链接中所述.您可以在连接中将自动提交设置为 true
以查看这是否会消失吗?
Generally, you should always commit (and rollback if an exception occurs) your transactions. Usually I never set auto commit to true but in this case I would like to understand if it's truly needed as mentioned in the link above. Can you set the auto commit to true
in your connection to see if this goes away?
<property name="hibernate.connection.autocommit" value="true"/>
这个链接还有一些关于hibernate事务管理的教程.
Also this link has some tutorials on transaction management with hibernate.
这篇关于更新 DB2 for iSeries 表时出错 SQL7008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:更新 DB2 for iSeries 表时出错 SQL7008
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01