-->
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: batch_versioned_data prevents StaleObjectStateException
PostPosted: Mon Sep 13, 2004 10:05 am 
Newbie

Joined: Mon Sep 13, 2004 9:44 am
Posts: 13
Hibernate version: 2.1.6

I've been using optimistic concurrency control with separate sessions and automatic versioning (as per ref 10.4.2). When there is a version mis-match, I catch StaleObjectStateException and take the appropriate action in my application. So far so good.

If I set hibernate.jdbc.batch_versioned_data to true in hibernate.properties, I no longer get a StaleObjectStateException, but a plain HibernateException. It comes from net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(). The code correctly checks the row count returned from the SQL UPDATE, but doesn't throw the expected StaleObjectStateException on a failure. This means I am unable to handle this expected concurrency error in my application.

The obvious work around is to set batch_versioned_data to false. However, my database (PostgreSQL 7.4) is correctly returning a row count of 0, not the broken -2 that JDBC allows, so it would be nice to be able to set it to true (and presumably get a minor speed up?).

Chris.


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.