Author: michiel
Date: 2010-06-21 11:40:56 +0200 (Mon, 21 Jun 2010)
New Revision: 42621

Modified:
   
mmbase/trunk/core/src/main/java/org/mmbase/storage/implementation/database/DatabaseStorageManager.java
Log:
avoid invalid buffer sizes

Modified: 
mmbase/trunk/core/src/main/java/org/mmbase/storage/implementation/database/DatabaseStorageManager.java
===================================================================
--- 
mmbase/trunk/core/src/main/java/org/mmbase/storage/implementation/database/DatabaseStorageManager.java
      2010-06-21 09:39:07 UTC (rev 42620)
+++ 
mmbase/trunk/core/src/main/java/org/mmbase/storage/implementation/database/DatabaseStorageManager.java
      2010-06-21 09:40:56 UTC (rev 42621)
@@ -161,12 +161,16 @@
             if (bufferSizeAttribute != null) {
                 try {
                     bufferSize = 
Integer.valueOf(bufferSizeAttribute.toString());
+                    if (bufferSize < 1) {
+                        log.warn("Found key invalid buffer size " + bufferSize 
+ ". Setting to 1.");
+                        bufferSize = 1;
+                    }
                     log.info("Found key buffer size " + bufferSize);
                 } catch (NumberFormatException nfe) {
                     // remove the SEQUENCE_BUFFER_SIZE attribute (invalid 
value)
                     factory.setAttribute(Attributes.SEQUENCE_BUFFER_SIZE, 
null);
                     log.error("The attribute 'SEQUENCE_BUFFER_SIZE' has an 
invalid value(" +
-                        bufferSizeAttribute + "), will be ignored.");
+                              bufferSizeAttribute + "), will be ignored.");
                 }
             }
         }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to