简体   繁体   中英

Error SQL7008 while updating a DB2 for iSeries table

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

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM