I just looked at the source of AbstractComplementaryConfigurableAction.java.
Is the descriptor unique in the whole JVM?
I think one should use resource.getSystemId() instead as key in the configurations 
map, as descriptor might be a relative path or somthing similar.

BTW: I really like C2!

Cheers,
Johannes Hofmann



Possible patch:


--- AbstractComplementaryConfigurableAction.java.orig   Thu Jul 26 11:12:41 2001
+++ AbstractComplementaryConfigurableAction.java        Thu Jul 26 11:17:52 2001
@@ -66,16 +66,16 @@
         }
 
         synchronized (AbstractComplementaryConfigurableAction.configurations) {
-            conf = (ConfigurationHelper) 
AbstractComplementaryConfigurableAction.configurations.get(descriptor);
-
-            if (reloadable || conf == null) {
-                SourceHandler sourceHandler = null;
-                Source resource = null;
-
-                try {
-                    sourceHandler = (SourceHandler) 
this.manager.lookup(SourceHandler.ROLE);
-                    resource = sourceHandler.getSource(null, descriptor);
+           SourceHandler sourceHandler = null;
+           Source resource = null;
+           
+           try {
+               sourceHandler = (SourceHandler) 
+this.manager.lookup(SourceHandler.ROLE);
+               resource = sourceHandler.getSource(null, descriptor);
+               
+               conf = (ConfigurationHelper) 
+AbstractComplementaryConfigurableAction.configurations.get(resource.getSystemId());
 
+               if (reloadable || conf == null) {
                    if (conf == null || conf.lastModified < 
resource.getLastModified()) {
                        getLogger().debug("(Re)Loading " + descriptor);
                        if (conf == null) 
@@ -87,18 +87,16 @@
                        conf.lastModified = resource.getLastModified();
                        conf.configuration = builder.getConfiguration();
                        
-                       this.cacheConfiguration(descriptor, conf);
+                       this.cacheConfiguration(resource.getSystemId(), conf);
                    } else {
                        getLogger().debug("Using cached configuration for " + 
descriptor);
                    }
-               } catch (Exception e) {
+               }
+           } catch (Exception e) {
                    getLogger().error("Could not configure Database mapping 
environment", e);
                     throw new ConfigurationException("Error trying to load 
configurations for resource: " + (resource == null ? "null" : 
resource.getSystemId()));
-                } finally {
+           } finally {
                     if (sourceHandler != null) this.manager.release((Component) 
sourceHandler);
-               }
-           } else {
-               getLogger().debug("Using fixed cached configuration for " + 
descriptor);
            }
         }
        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to