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

Modified Files:
        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.189
retrieving revision 1.190
diff -u -b -r1.189 -r1.190
--- DatabaseStorageManager.java 18 Feb 2008 12:43:17 -0000      1.189
+++ DatabaseStorageManager.java 19 Mar 2008 11:52:51 -0000      1.190
@@ -32,7 +32,7 @@
  *
  * @author Pierre van Rooden
  * @since MMBase-1.7
- * @version $Id: DatabaseStorageManager.java,v 1.189 2008/02/18 12:43:17 
michiel Exp $
+ * @version $Id: DatabaseStorageManager.java,v 1.190 2008/03/19 11:52:51 
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
      */
@@ -796,12 +801,15 @@
         }
     }
 
+
+    // Determines whether blob warnings have been issued
+    static private boolean blobsOnDiskWarningIssued = true;
+
     /**
      * Checks whether file is readable and existing. Warns if not.
      * 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()) {
@@ -811,16 +819,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