-->
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: Safe to change BatchingBatcher to not count rows?
PostPosted: Fri Sep 08, 2006 3:12 pm 
Newbie

Joined: Thu Sep 07, 2006 2:53 pm
Posts: 2
I would like to change org.hibernate.jdbc.BatchingBatcher and org.hibernate.jdbc.NonBatchingBatcher to fail silently if the number of rows inserted doesn't match the number it expected. I want to do this because I have a before-insert trigger that denies insertion on duplicate or banned rows, so if a row shouldn't be inserted "NULL" is returned to JDBC, signifying that no insert should be performed.

I propose changing line 92 of Batching Batcher:
Code:
if ( rowCount<expectedRowCount ) {
               throw new StaleStateException(
                     "Batch update returned unexpected row count from update: " + i +
                     " actual row count: " + rowCount +
                     " expected: " + expectedRowCount
               );
            }


by just commenting out the stalestateexception throwage. This would fix my problem, but will this leave hibernate in a safe state moving forward?

Is this exception relied on heavily somewhere else?

Regards,
B


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.