[hibernate-dev] Possible to confirm that versioning is broken forPersistentSets?

Steve Ebersole steve.ebersole at jboss.com
Thu Aug 31 09:42:37 EDT 2006


OptimisticLockTest was failing on certain databases because the test was
poorly written; it was relying on my local setting of not using
statement batching for versioned data.  I have updated the test to
explicitly disable batching of versioned data.

Try adding the following to your local copy and see if that fixes the
error you see.  If not open a JIRA case with the failure, as that would
be a bug.

-----Original Message-----
From: Josh Moore [mailto:josh.moore at gmx.de] 
Sent: Thursday, August 31, 2006 8:10 AM
To: Steve Ebersole
Cc: Max Andersen; hibernate-dev at lists.jboss.org; koda2 at bbs.darktech.org
Subject: Re: [hibernate-dev] Possible to confirm that versioning is
broken forPersistentSets?

Ok. The isDirty()/write()/add()/clearDirty() idiom explains why the 
patch was producing NPEs in other tests. Otherwise, the only other 
failures that seemed they could be related were from the optlock tests. 
Two were failing earlier (see 
http://opensource.atlassian.com/projects/hibernate/secure/attachment/125
60/TEST-org.hibernate.test.optlock.OptimisticLockTest.txt) 
but all are failing with the patch, e.g.:

Testcase: testOptimisticLockAllDelete took 0.134 sec
         Caused an ERROR
Batch update returned unexpected row count from update [0]; actual row 
count: 0; expected: 1

~Josh.

Steve Ebersole wrote:
> I've made some changes here locally which attempt to group fixes to a
> bunch of these seemingly related issues.  So for PersistentSet.add()
> (for example), I have:
> 
> 
> 	public boolean add(Object value) {
> 		Boolean exists = isOperationQueueEnabled() ?
> 				readElementExistence(value) : null;
> 		if ( exists == null ) {
> 			boolean initiallyDirty = isDirty();
> 			write();
> 			boolean actuallyAdded = set.add( value );
> 			if ( !actuallyAdded ) {
> 				if ( ! initiallyDirty && isDirty() ) {
> 					clearDirty();
> 				}
> 			}
> 			return actuallyAdded;
> 		}
> 		else if ( exists.booleanValue() ) {
> 			return false;
> 		}
> 		else {
> 			queueOperation( new SimpleAdd(value) );
> 			return true;
> 		}
> 	}
> 
> But I need to get time to properly test these changes before I commit
> them.




More information about the hibernate-dev mailing list