Hibernate version: 3
Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="com.nic.ds.model.BcastsDsDocs" table="BCASTS_DS_DOCS">
<id name="id" column="BCASTS_ID" type="integer" />
<property name="camp_code" column="CAMP_CODE" type="string" />
</class>
</hibernate-mapping>
Code :Code:
final BcastsDsDocs bdd = new BcastsDsDocs();
bdd.setId(broadcastId);
bdd.setCamp_code(doc.getCampCode());
final BcastsDsDocsManager bddm = new BcastsDsDocsManager();
bddm.save(bdd);
Full stack trace of any exception that occurs:Code:
Hibernate: insert into BCASTS_DS_DOCS (CAMP_CODE, BCASTS_ID) values (?, ?)
2008-03-26 15:04:08,319 WARN [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:71) - SQL Error: -551, SQLState: 42501
2008-03-26 15:04:08,319 ERROR [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:72) - DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: DB2ADMIN;INSERT;DB2ADMIN.BCASTS_DS_DOCS
2008-03-26 15:04:08,319 WARN [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:71) - SQL Error: -727, SQLState: 56098
2008-03-26 15:04:08,319 ERROR [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:72) - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-551;42501;DB2ADMIN|INSERT|DB2ADMIN.BCASTS_DS_DOCS
2008-03-26 15:04:08,319 WARN [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:71) - SQL Error: -727, SQLState: 56098
2008-03-26 15:04:08,320 ERROR [SchedulerJobThread:BLStmt:3676_1] (JDBCExceptionReporter.java:72) - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-551;42501;DB2ADMIN|INSERT|DB2ADMIN.BCASTS_DS_DOCS
2008-03-26 15:04:08,320 ERROR [SchedulerJobThread:BLStmt:3676_1] (AbstractFlushingEventListener.java:300) - Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: could not insert: [com.nic.ds.model.BcastsDsDocs]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2202)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2595)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
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.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:488)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:435)
at com.nic.hibernate.HibernateUtil.commit(HibernateUtil.java:105)
at com.nic.ds.cserver.BLStatementJobExecutor.execute(BLStatementJobExecutor.java:210)
at com.nic.scheduler3.impl.JobThread.run(JobThread.java:71)
Caused by: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: DB2ADMIN;INSERT;DB2ADMIN.BCASTS_DS_DOCS
at com.ibm.db2.jcc.a.hd.e(hd.java:1659)
at com.ibm.db2.jcc.a.hd.a(hd.java:1235)
at com.ibm.db2.jcc.c.jb.h(jb.java:149)
at com.ibm.db2.jcc.c.jb.a(jb.java:43)
at com.ibm.db2.jcc.c.w.a(w.java:30)
at com.ibm.db2.jcc.c.cc.g(cc.java:160)
at com.ibm.db2.jcc.a.hd.n(hd.java:1215)
at com.ibm.db2.jcc.a.id.gb(id.java:1780)
at com.ibm.db2.jcc.a.id.d(id.java:2255)
at com.ibm.db2.jcc.a.id.Y(id.java:537)
at com.ibm.db2.jcc.a.id.executeUpdate(id.java:520)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2182)
... 15 more
Name and version of the database you are using:DB2 8.1
The generated SQL (show_sql=true):Code:
Hibernate: insert into BCASTS_DS_DOCS (CAMP_CODE, BCASTS_ID) values (?, ?)
Please help... :(