-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: setting isolation levels with hibernate and DB2/AS400
PostPosted: Thu Aug 21, 2008 6:09 am 
Newbie

Joined: Thu Aug 21, 2008 5:28 am
Posts: 4
Location: india
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

_________________
saurabhjain


Top
 Profile  
 
 Post subject: Re: setting isolation levels with hibernate and DB2/AS400
PostPosted: Thu Aug 21, 2008 9:45 am 
Newbie

Joined: Thu Aug 21, 2008 5:28 am
Posts: 4
Location: india
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 use journaling.

_________________
saurabhjain


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 22, 2008 4:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
This question has nothing to do with tools. Use the user forum or consider getting support.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.