[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6872) Test failures with hibernate.jdbc.batch_versioned_data=true

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 2 04:39:19 EST 2011


Test failures with hibernate.jdbc.batch_versioned_data=true
-----------------------------------------------------------

                 Key: HHH-6872
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6872
             Project: Hibernate Core
          Issue Type: Bug
          Components: testsuite
            Reporter: Gail Badner
            Assignee: Gail Badner


The following tests fail with hibernate.jdbc.batch_versioned_data=true:
 org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseManyToManyTest.testManyToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyFailureExpectedTest.testOneToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyJoinFailureExpectedTest.testOneToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyJoinTest.testOneToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyTest.testOneToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseManyToManyTest.testManyToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseOneToManyJoinTest.testOneToManyCollectionOptimisticLockingWithUpdate
org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseOneToManyTest.testOneToManyCollectionOptimisticLockingWithUpdate 

These tests expect StaleObjectStateException to be thrown when an update fails due to an optimistic locking failure. When batching is used, StaleStateException is thrown instead because at the time that the batch statement executes, the entity name and ID are no longer available.

The fix is to change the tests to expect StaleStateException and to check that the exception is a StaleObjectStateException instance when batching is not used.

These tests only failed using Sybase because that is the only DB platform for which hibernate.jdbc.batch_versioned_data=true.

I believe that hibernate.jdbc.batch_versioned_data=true should be used for all DB platforms being tested, except for Oracle. The version of Oracle JDBC used for testing still does not return row counts for batch updates.

The src/test/resources hibernate.properties for each submodule will be updated to set hibernate.jdbc.batch_versioned_data=true. The setting will need to be set to false when testing with Oracle.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list