更新 DB2 for iSeries 表时出现错误 SQL7008
我有一个使用 Hibernate 和 DB2 for iSeries 的 Java Web 应用程序,在更新表期间出现以下错误:-
更新 DB2 时出现错误 SQL7008 i系列表
I have a Java Web application using Hibernate and DB2 for iSeries
and during update of a table I get he following error:-
Error SQL7008 while updating a DB2 for
iSeries table
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过对此错误消息进行一些谷歌搜索,我注意到当您在非事务模式下运行插入/更新时会发生这种情况。 此处给出了解释。
一般来说,您应该始终提交(如果发生异常则回滚)事务。通常我从不将自动提交设置为 true,但在这种情况下,我想了解是否真正需要它,如上面的链接中所述。您可以在连接中将自动提交设置为
true
来看看这种情况是否会消失吗?还有这个 链接有一些关于使用hibernate进行事务管理的教程。
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.
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"/>
Also this link has some tutorials on transaction management with hibernate.
我找到了我的问题的答案
正如 CoolBeans 提到的,发生这种情况是因为我尝试更新的表没有被记录。
将此表添加到 Journal,这里是 步骤
这解决了我的问题。
I found the answer to my question,
This occurs As CoolBeans mentioned because the table I was trying to update is not being journalled.
Add this table to Journal, here are the steps
this took care of my problem.