cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1202782 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java
Date Wed, 16 Nov 2011 17:05:57 GMT
Author: aadamchik
Date: Wed Nov 16 17:05:56 2011
New Revision: 1202782

URL: http://svn.apache.org/viewvc?rev=1202782&view=rev
Log:
conditional logging to avoid unneeded string conversion of huge snapshot maps

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java?rev=1202782&r1=1202781&r2=1202782&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataRowStore.java
Wed Nov 16 17:05:56 2011
@@ -480,11 +480,17 @@ public class DataRowStore implements Ser
                     // case 4 above... have to throw out the snapshot since
                     // no good options exist to tell how to merge the two.
                     if (oldSnapshot.getVersion() != newSnapshot.getReplacesVersion()) {
-                        logger
-                                .debug("snapshot version changed, don't know what to do...
Old: "
-                                        + oldSnapshot
-                                        + ", New: "
-                                        + newSnapshot);
+
+                        // snapshots can be huge potentially.. so print them only if the
+                        // user is expecting them to be printed
+                        if (logger.isDebugEnabled()) {
+                            logger
+                                    .debug("snapshot version changed, don't know what to
do... Old: "
+                                            + oldSnapshot
+                                            + ", New: "
+                                            + newSnapshot);
+                        }
+                        
                         forgetSnapshot(key);
                         continue;
                     }



Mime
View raw message