Setting isolation levels with hibernate and DB2/AS400

5 pts.
Tags:
Database programming
DB2/400
Isolation level
I am using hibernate with DB2/AS400. When I set any isoltion level other than '0' in the hibernate.cfg.xml and try to insert/update data in the table on DB2/AS400, The Exception '' could not update :" occurs. Update is succesful for isolation level 0. Please guide how this can be solved. Following is the error stack trace. could not update: [com.test.dto.TestDTO#10] org.hibernate.exception.GenericJDBCException: could not update: [com.test.dto.TestDTO#10] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2221) at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2117) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2373) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:345) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at com.test.dao.TestDAO.insertData(TestDAO.java:72) at com.test.dao.TestDAO.main(TestDAO.java:117) Caused by: java.sql.SQLException: [SQL7008] APAP0400 in TRUGER not valid for operation. at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621) at com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatement.java:896) at com.ibm.as400.access.AS400JDBCPreparedStatement.executeUpdate(AS400JDBCPreparedStatement.java:1154) at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2203) ... 13 more ------------------------------ I would like to add that if we set property autocommit "true" in hibernate.cfg file or through connection().setAutocommit() then I am able to use higher isolation levels like 2,4 or 8. But the data is actually not updated in the database. Ya using journaling solves the problem, but our requirement does not allow to use journaling. So in short, the exact problem is that I need to use higher isolation levels (2,4 or 8) and update data in the database (db2/AS400) without using journaling.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following