Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HHH-6872 : Test failures with hibernate.jdbc.batch_versioned_data=true

  • Loading branch information...
commit af3767b82a16a62c273a9e3c7865ea955de2c570 1 parent 0af7d06
@gbadner gbadner authored
View
3  hibernate-c3p0/src/test/resources/hibernate.properties
@@ -40,3 +40,6 @@ hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
+
+# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
+hibernate.jdbc.batch_versioned_data true
View
9 ...ibernate/test/immutable/entitywithmutablecollection/AbstractEntityWithManyToManyTest.java
@@ -29,6 +29,7 @@
import org.hibernate.MappingException;
import org.hibernate.Session;
import org.hibernate.StaleObjectStateException;
+import org.hibernate.StaleStateException;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
@@ -55,7 +56,6 @@
@Override
public void configure(Configuration cfg) {
cfg.setProperty( Environment.GENERATE_STATISTICS, "true");
- cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" );
}
@Override
@@ -934,9 +934,12 @@ public void testManyToManyCollectionOptimisticLockingWithUpdate() {
t.commit();
assertFalse( isContractVersioned );
}
- catch (StaleObjectStateException ex) {
- assertTrue( isContractVersioned);
+ catch (StaleStateException ex) {
t.rollback();
+ assertTrue( isContractVersioned );
+ if ( ! sessionFactory().getSettings().isJdbcBatchVersionedData() ) {
+ assertTrue( StaleObjectStateException.class.isInstance( ex ) );
+ }
}
s.close();
View
9 ...hibernate/test/immutable/entitywithmutablecollection/AbstractEntityWithOneToManyTest.java
@@ -27,6 +27,7 @@
import org.hibernate.QueryException;
import org.hibernate.Session;
import org.hibernate.StaleObjectStateException;
+import org.hibernate.StaleStateException;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
@@ -53,7 +54,6 @@
private boolean isContractVersioned;
public void configure(Configuration cfg) {
cfg.setProperty( Environment.GENERATE_STATISTICS, "true");
- cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" );
}
protected boolean checkUpdateCountsAfterAddingExistingElement() {
@@ -1181,9 +1181,12 @@ public void testOneToManyCollectionOptimisticLockingWithUpdate() {
t.commit();
assertFalse( isContractVersioned );
}
- catch (StaleObjectStateException ex) {
- assertTrue( isContractVersioned);
+ catch (StaleStateException ex) {
t.rollback();
+ assertTrue( isContractVersioned );
+ if ( ! sessionFactory().getSettings().isJdbcBatchVersionedData() ) {
+ assertTrue( StaleObjectStateException.class.isInstance( ex ) );
+ }
}
s.close();
View
3  hibernate-core/src/test/resources/hibernate.properties
@@ -34,3 +34,6 @@ hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
+
+# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
+hibernate.jdbc.batch_versioned_data true
View
3  hibernate-ehcache/src/test/resources/hibernate.properties
@@ -29,3 +29,6 @@ hibernate.connection.username sa
hibernate.connection.pool_size 5
hibernate.cache.region_prefix hibernate.test
+
+# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
+hibernate.jdbc.batch_versioned_data true
View
3  hibernate-entitymanager/src/test/resources/hibernate.properties
@@ -36,3 +36,6 @@ hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
hibernate.jdbc.batch_size 0
+
+# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
+hibernate.jdbc.batch_versioned_data true
View
3  hibernate-infinispan/src/test/resources/hibernate.properties
@@ -34,3 +34,6 @@ hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.generate_statistics true
+
+# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
+hibernate.jdbc.batch_versioned_data true
Please sign in to comment.
Something went wrong with that request. Please try again.