Hi.
I have a JPA (backed by hibernate) application which does an insert into a postgresql database. The insert is caught by a postgresql trigger and redirected to another table, but as no insert actually happens in the target table the return value from the INSERT query is 0. Same happens with UPDATE queries.
At this point hibernate complains that the return value from the INSERT/UPDATE was unexpected. How can I convince it to trust me on this?
Hibernate version:
Hibernate 3.2.6
Full stack trace of any exception that occurs:
ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
Name and version of the database you are using:
PostgreSQL version 8.3
Thanks,
Adrian
|