-->
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.  [ 1 post ] 
Author Message
 Post subject: Overriding StaleStateException
PostPosted: Tue Jun 24, 2008 5:37 am 
Newbie

Joined: Tue Jun 24, 2008 5:23 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.