jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r832690 - /jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
Date Wed, 04 Nov 2009 09:44:30 GMT
Author: thomasm
Date: Wed Nov  4 09:44:30 2009
New Revision: 832690

URL: http://svn.apache.org/viewvc?rev=832690&view=rev
Log:
JCR-2369 Problem importing node with binary property in a repository configured with datastore

Modified:
    jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java

Modified: jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java?rev=832690&r1=832689&r2=832690&view=diff
==============================================================================
--- jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
(original)
+++ jackrabbit/branches/1.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
Wed Nov  4 09:44:30 2009
@@ -601,8 +601,10 @@
             switch (state.getType()) {
                 case PropertyType.BINARY:
                     BLOBFileValue blobVal = val.getBLOBFileValue();
+                    long size = blobVal.getLength();
                     if (InternalValue.USE_DATA_STORE && dataStore != null) {
-                        if (blobVal.isSmall()) {
+                        int maxMemorySize = dataStore.getMinRecordLength() - 1;
+                        if (size < maxMemorySize) {
                             writeSmallBinary(out, blobVal, state, i);
                         } else {
                             out.writeInt(BINARY_IN_DATA_STORE);
@@ -620,7 +622,6 @@
                     }
                     // special handling required for binary value:
                     // spool binary value to file in blob store
-                    long size = blobVal.getLength();
                     if (size < 0) {
                         log.warn("Blob has negative size. Potential loss of data. "
                                 + "id={} idx={}", state.getId(), String.valueOf(i));



Mime
View raw message