diff --git a/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationBase.java b/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationBase.java
index b5192cf..0ef0ecd 100644
--- a/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationBase.java
+++ b/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationBase.java
@@ -104,8 +104,38 @@
     }
 
 
+    /**
+     * Returns the "official" bundle location as visible from the outside
+     * world of code calling into the Configuration.getBundleLocation() method.
+     * <p>
+     * In other words: The {@link #getStaticBundleLocation()} is returned if
+     * not <code>null</code>. Otherwise the {@link #getDynamicBundleLocation()}
+     * is returned (which may also be <code>null</code>).
+     */
     String getBundleLocation()
     {
+        if ( staticBundleLocation != null )
+        {
+            return staticBundleLocation;
+        }
+
+        return dynamicBundleLocation;
+    }
+
+
+    /**
+     * Returns the bundle location according to actual configuration binding.
+     * <p>
+     * This may be different from the {@link #getBundleLocation()} result if
+     * the <code>Configuration.setBundleLocation(String)</code> method has been
+     * called after the configuration has been dynamically bound to a bundle.
+     * <p>
+     * In other words: The {@link #getDynamicBundleLocation()} is returned if
+     * not <code>null</code>. Otherwise the {@link #getStaticBundleLocation()}
+     * is returned (which may also be <code>null</code>).
+     */
+    String getBoundBundleLocation()
+    {
         if ( dynamicBundleLocation != null )
         {
             return dynamicBundleLocation;
@@ -127,14 +157,6 @@
     }
 
 
-    boolean isStaticallyBound()
-    {
-        // TODO: consider static location too ? to indicate whether we are
-        // actually bound ?
-        return dynamicBundleLocation == null;
-    }
-
-
     void setServiceReference( ServiceReference serviceReference )
     {
         this.serviceReference = serviceReference;
@@ -157,6 +179,10 @@
         // location is statically set, the old binding must be removed
         // by removing the configuration from the targets and the new binding
         // must be setup by updating the configuration for new targets
+        /*
+         * According to BJ Hargrave configuration is not re-dispatched
+         * due to setting the static bundle location.
+         * The following code is therefore disabled for now
         if ( ( this instanceof ConfigurationImpl ) && ( bundleLocation != null ) )
         {
             // remove configuration from current managed service [factory]
@@ -168,6 +194,8 @@
             // check whether we have to assign the configuration to new targets
             getConfigurationManager().reassignConfiguration( ( ConfigurationImpl ) this );
         }
+         *
+         */
     }
 
 
@@ -179,10 +207,16 @@
         // FELIX-1488: If a dynamically bound configuration is unbound and not
         // statically bound, it may be rebound to another bundle asking for it
         // (unless the dynamic unbind happens due to configuration deletion)
+        /*
+         * According to BJ Hargrave configuration is not re-dispatched
+         * due to setting the static bundle location.
+         * The following code is therefore disabled for now
         if ( bundleLocation == null && getStaticBundleLocation() == null && ( this instanceof ConfigurationImpl ) )
         {
             getConfigurationManager().reassignConfiguration( ( ConfigurationImpl ) this );
         }
+         *
+         */
     }
 
 
diff --git a/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java b/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
index 7fabdda..7890946 100644
--- a/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
+++ b/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
@@ -1316,7 +1316,7 @@
                         // find the primary configuration owner
                         final ServiceReference ownerRef = getOwner( config, srList );
                         final String bundleLocation = ( ownerRef != null ) ? ownerRef.getBundle().getLocation()
-                            : config.getBundleLocation();
+                            : config.getBoundBundleLocation();
 
                         // if the configuration is unbound, bind to owner
                         if ( config.getBundleLocation() == null )
@@ -1383,13 +1383,14 @@
                         // find the primary configuration owner
                         final ServiceReference ownerRef = getOwner( config, srList );
                         final String bundleLocation = ( ownerRef != null ) ? ownerRef.getBundle().getLocation()
-                            : config.getBundleLocation();
+                            : config.getBoundBundleLocation();
 
                         // if the configuration is unbound, bind to owner
                         if ( config.getBundleLocation() == null )
                         {
                             config.setDynamicBundleLocation( bundleLocation );
                         }
+                        final String configBundleLocation = config.getBundleLocation();
 
                         // provide configuration to all services from the
                         // correct bundle
@@ -1399,11 +1400,11 @@
                             final String refLocation = ref.getBundle().getLocation();
 
                             // only consider the entry if in the same bundle
-                            if ( !refLocation.equals( config.getBundleLocation() ) )
+                            if ( !refLocation.equals( configBundleLocation ) )
                             {
                                 log( LogService.LOG_ERROR, "Cannot use configuration " + config.getPid() + " (factory "
                                     + config.getFactoryPid() + ") for " + ConfigurationManager.toString( ref )
-                                    + ": Configuration bound to bundle " + config.getBundleLocation(), null );
+                                    + ": Configuration bound to bundle " + configBundleLocation, null );
 
                                 continue;
                             }
@@ -1475,7 +1476,7 @@
 
             // if the configuration is location bound, find a service reference
             // from the same bundle
-            final String configLocation = config.getBundleLocation();
+            final String configLocation = config.getBoundBundleLocation();
             if (configLocation != null) {
                 for ( int i = 0; i < srList.length; i++ )
                 {
@@ -1519,7 +1520,7 @@
              * final and cannot be reset.
              */
             this.config = config;
-            this.configLocation = config.getBundleLocation();
+            this.configLocation = config.getBoundBundleLocation();
             this.fireEvent = fireEvent;
         }
 
