Hi if I am using the same way in my code I am getting the following exception.
Hibernate: /* insert com.save.beans.Master */ insert into MSTR (ID, VRSN, CUR_CD, CUR_STAT, AGT_AUTH_CD, NBR, MOD_ACS_CD, HAZ_DVN_ACS_CD, TOOL_NME, TOOL_ACS_CMNT, ACS_CD, ACS_NME, ACS_CMNT, CRET_ID, CRET_TS, EXP_DT, LST_MAINT_ID, LST_MAINT_TS) values (default, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -407, SQLState: 23502 [main] ERROR org.hibernate.util.JDBCExceptionReporter - DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=527, COLNO=0, DRIVER=3.57.82 Exception in thread "main" org.hibernate.HibernateException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.save.beans.LOAMaster] at com.save.hibernate.MasterForSaveUpdate.main(MasterForSaveUpdate.java:126) Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.save.beans.Master] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527) at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241) at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292) at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:240) at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193) at org.hibernate.engine.Cascade.cascade(Cascade.java:154) at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:454) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527) at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523) at com.save.hibernate.MasterForSaveUpdate.main(MasterForSaveUpdate.java:107) Caused by: com.ibm.db2.jcc.am.fo: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=527, COLNO=0, DRIVER=3.57.82 at com.ibm.db2.jcc.am.bd.a(bd.java:672) at com.ibm.db2.jcc.am.bd.a(bd.java:60) at com.ibm.db2.jcc.am.bd.a(bd.java:127) at com.ibm.db2.jcc.am.km.b(km.java:2164) at com.ibm.db2.jcc.am.km.c(km.java:2147) at com.ibm.db2.jcc.t4.db.k(db.java:354) at com.ibm.db2.jcc.t4.db.a(db.java:60) at com.ibm.db2.jcc.t4.t.a(t.java:50) at com.ibm.db2.jcc.t4.tb.b(tb.java:218) at com.ibm.db2.jcc.am.lm.ec(lm.java:2692) at com.ibm.db2.jcc.am.lm.b(lm.java:3552) at com.ibm.db2.jcc.am.lm.Wb(lm.java:690) at com.ibm.db2.jcc.am.lm.executeUpdate(lm.java:673) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57) ... 30 more
Please help me to solve this issue. I am working for this 2 days. I dont know what to do next.
|