diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java b/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java index 272241b070..53d7415a51 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java @@ -1345,18 +1345,7 @@ public class Configuration implements Serializable { metadataSourceQueue.processMetadata( determineMetadataSourcePrecedence() ); } - // process cache queue - { - for ( CacheHolder holder : caches ) { - if ( holder.isClass ) { - applyCacheConcurrencyStrategy( holder ); - } - else { - applyCollectionCacheConcurrencyStrategy( holder ); - } - } - caches.clear(); - } + try { inSecondPass = true; @@ -1376,6 +1365,19 @@ public class Configuration implements Serializable { throw ( RuntimeException ) e.getCause(); } + // process cache queue + { + for ( CacheHolder holder : caches ) { + if ( holder.isClass ) { + applyCacheConcurrencyStrategy( holder ); + } + else { + applyCollectionCacheConcurrencyStrategy( holder ); + } + } + caches.clear(); + } + for ( Map.Entry> tableListEntry : uniqueConstraintHoldersByTable.entrySet() ) { final Table table = tableListEntry.getKey(); final List uniqueConstraints = tableListEntry.getValue();