mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-04 00:39:36 +00:00
HHH-6872 : Test failures with hibernate.jdbc.batch_versioned_data=true
This commit is contained in:
parent
0af7d0645d
commit
af3767b82a
@ -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
|
||||
|
@ -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 @@ public abstract class AbstractEntityWithManyToManyTest extends BaseCoreFunctiona
|
||||
@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();
|
||||
|
||||
|
@ -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 @@ public abstract class AbstractEntityWithOneToManyTest extends BaseCoreFunctional
|
||||
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();
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user