From 7f10972048ede7f06c4f18af7e5924b0d97e5eb5 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Mon, 6 Aug 2012 14:37:27 +0800 Subject: [PATCH] HHH-2808 CLONE -Impossible to define caching for a subclass's collection in hibernate.cgf.xml --- .../java/org/hibernate/cfg/Configuration.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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();