This is the code:
when i execute it, i still get the following message:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: insert into Author (name, id) values (?, ?)
Hibernate: insert into Book (name, id) values (?, ?)
Hibernate: insert into Book (name, id) values (?, ?)
Could not execute
JDBC batch update
Hibernate: update Book set id=?, idx=? where id=?
Hibernate: update Book set id=?, idx=? where id=?
Hibernate: update Book set id=?, idx=? where id=?
Hibernate: update Book set id=?, idx=? where id=?
Exception in thread "main" org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 1 actual row count: 0 expected: 1
at org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:88)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:74)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at roseindia.tutorial.hibernatecollections.InsertRecord.main(InsertRecord.java:43)
What could be the reason? Kindly help me.