-->
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.  [ 2 posts ] 
Author Message
 Post subject: SQL Error: -204, SQL Error: -727
PostPosted: Thu Jul 31, 2008 6:49 am 
Regular
Regular

Joined: Tue Jun 03, 2008 1:12 pm
Posts: 84
Location: germany
I have a manyToMany-Relation between two Entites..when I wanna delete some entities then I get the following error:

Code:
10:44:52,764 WARN  [JDBCExceptionReporter] SQL Error: -99999, SQLState: null
10:44:52,764 ERROR [JDBCExceptionReporter] Non-atomic batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
10:44:52,764 WARN  [JDBCExceptionReporter] SQL Error: -204, SQLState: 42704
10:44:52,764 ERROR [JDBCExceptionReporter] Error for batch element #0: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: DB.ROLES
10:44:52,764 WARN  [JDBCExceptionReporter] SQL Error: -727, SQLState: 56098
10:44:52,764 ERROR [JDBCExceptionReporter] Error for batch element #0: DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB.ROLES
10:44:52,764 WARN  [JDBCExceptionReporter] SQL Error: -727, SQLState: 56098
10:44:52,764 ERROR [JDBCExceptionReporter] Error for batch element #0: DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB.ROLES
10:44:52,764 WARN  [JDBCExceptionReporter] SQL Error: -727, SQLState: 56098
10:44:52,764 ERROR [JDBCExceptionReporter] Error for batch element #1: DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;DB.ROLES
10:44:52,764 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
   at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
   at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
   at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
   at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
   at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
   at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1389)
   at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTran
...


The table "DB.ROLES" still exists in my Database. I have no explicit Java-Entity as I mapped it with the ManyToMany-Relationship.

Any Ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 7:34 am 
Regular
Regular

Joined: Tue Jun 03, 2008 1:12 pm
Posts: 84
Location: germany
I solved this problem by changing all the CASCADE-Options from

Code:
cascadeType.ALL


to

Code:
cascade ={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}


Now I can delete without problems.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.