diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java index 0986ab6609..6ea4441f71 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java @@ -43,6 +43,8 @@ public abstract class AbstractOneSessionTest extends AbstractEnversTest { config = new Configuration(); URL url = Thread.currentThread().getContextClassLoader().getResource( getHibernateConfigurationFileName() ); config.configure( new File( url.toURI() ) ); + // Envers tests expect sequences to not skip values... + config.setProperty( EnversSettings.REVISION_SEQUENCE_NOCACHE, "true" ); String auditStrategy = getAuditStrategy(); if ( auditStrategy != null && !"".equals( auditStrategy ) ) { diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java index 13ce80d1ed..c09de09175 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java @@ -76,6 +76,8 @@ public abstract class BaseEnversFunctionalTestCase extends BaseNonConfigCoreFunc super.addSettings( settings ); settings.put( EnversSettings.USE_REVISION_ENTITY_WITH_NATIVE_ID, "false" ); + // Envers tests expect sequences to not skip values... + settings.put( EnversSettings.REVISION_SEQUENCE_NOCACHE, "true" ); if ( getAuditStrategy() != null ) { settings.put( EnversSettings.AUDIT_STRATEGY, getAuditStrategy() ); diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java index 851ee137b7..40927fe1ac 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java @@ -157,6 +157,8 @@ public abstract class BaseEnversJPAFunctionalTestCase extends AbstractEnversTest SharedDriverManagerConnectionProviderImpl.getInstance() ); } + // Envers tests expect sequences to not skip values... + config.put( EnversSettings.REVISION_SEQUENCE_NOCACHE, "true" ); addConfigOptions( config ); return config; diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/strategy/ValidityAuditStrategyManyToManyTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/strategy/ValidityAuditStrategyManyToManyTest.java index ff21a61143..cd42a4cfba 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/strategy/ValidityAuditStrategyManyToManyTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/strategy/ValidityAuditStrategyManyToManyTest.java @@ -44,7 +44,6 @@ public class ValidityAuditStrategyManyToManyTest extends BaseEnversJPAFunctional @Override protected void addConfigOptions(Map options) { options.put( EnversSettings.AUDIT_STRATEGY, "org.hibernate.envers.strategy.ValidityAuditStrategy" ); - options.put( EnversSettings.REVISION_SEQUENCE_NOCACHE, "true" ); } @Test