Update of /var/cvs/src/org/mmbase/storage/implementation/database
In directory 
james.mmbase.org:/tmp/cvs-serv514/src/org/mmbase/storage/implementation/database

Modified Files:
      Tag: MMBase-1_8
        DatabaseStorageManager.java 
Log Message:
warn only once when blob files cannotn be found, except when debugging


See also: 
http://cvs.mmbase.org/viewcvs/src/org/mmbase/storage/implementation/database


Index: DatabaseStorageManager.java
===================================================================
RCS file: 
/var/cvs/src/org/mmbase/storage/implementation/database/DatabaseStorageManager.java,v
retrieving revision 1.169.2.9
retrieving revision 1.169.2.10
diff -u -b -r1.169.2.9 -r1.169.2.10
--- DatabaseStorageManager.java 7 Mar 2008 14:41:26 -0000       1.169.2.9
+++ DatabaseStorageManager.java 19 Mar 2008 11:52:47 -0000      1.169.2.10
@@ -32,7 +32,7 @@
  *
  * @author Pierre van Rooden
  * @since MMBase-1.7
- * @version $Id: DatabaseStorageManager.java,v 1.169.2.9 2008/03/07 14:41:26 
michiel Exp $
+ * @version $Id: DatabaseStorageManager.java,v 1.169.2.10 2008/03/19 11:52:47 
pierre Exp $
  */
 public class DatabaseStorageManager implements StorageManager {
 
@@ -70,6 +70,11 @@
     private static boolean legacyWarned = false;
 
     /**
+     * Whether the warning about blobs located on disk was given.
+     */
+    private boolean blobsOnDiskWarned = false;
+
+    /**
      * The cache that contains the last X types of all requested objects
      * @since 1.7
      */
@@ -802,7 +807,6 @@
      * If non-existing it checks older locations.
      * @return the file to be used, or <code>null</code> if no existing 
readable file could be found, also no 'legacy' one.
      */
-
     protected File checkFile(File binaryFile, MMObjectNode node, CoreField 
field) {
         String fieldName = field.getName();
         if (!binaryFile.canRead()) {
@@ -812,16 +816,18 @@
                 File legacy = getLegacyBinaryFile(node, fieldName);
                 if (legacy == null) {
                     if (field.isNotNull() && 
!binaryFile.getParentFile().exists()) {
-                        log.warn("The file '" + binaryFile + "' does not 
exist, " + desc, new Exception());
+                        if (!blobsOnDiskWarned || log.isDebugEnabled()) {
+                            log.warn("The file '" + binaryFile + "' does not 
exist, " + desc);
                         log.info("If you upgraded from older MMBase version, 
it might be that the blobs were stored on a different location. Make sure your 
blobs are in '"
                                  + factory.getBinaryFileBasePath()
                                  + "' (perhaps use symlinks?). If you changed 
configuration to 'blobs-on-disk' while it was blobs-in-database. Go to 
admin-pages.");
-
+                            blobsOnDiskWarned = true;
+                        }
                     } else if (log.isDebugEnabled()) {
                         log.debug("The file '" + binaryFile + "' does not 
exist. Probably the blob field is simply 'null'");
                     }
                 } else {
-                    if (!legacyWarned) {
+                    if (!legacyWarned || log.isDebugEnabled()) {
                         log.warn("Using the legacy location '" + legacy + "' 
rather then '" + binaryFile + "'. You might want to convert this dir.");
                         legacyWarned = true;
                     }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to