jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1151224 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
Date Tue, 26 Jul 2011 20:13:55 GMT
Author: thomasm
Date: Tue Jul 26 20:13:54 2011
New Revision: 1151224

URL: http://svn.apache.org/viewvc?rev=1151224&view=rev
Log:
Workaround for a bug in H2.

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java?rev=1151224&r1=1151223&r2=1151224&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/H2RevisionStore.java
Tue Jul 26 20:13:54 2011
@@ -243,6 +243,17 @@ public class H2RevisionStore extends Sim
                 if (!rs.next()) {
                     throw new MicroKernelException("Blob not found: " + blobId);
                 }
+
+                int TODO_WORKAROUND_FOR_H2_BUG;
+                int max = (int) Math.min(length, getBlobLength(blobId) - pos);
+                if (max != length) {
+                    if (max <= 0) {
+                        rs.close();
+                        return -1;
+                    }
+                    length = max;
+                }
+
                 InputStream in = rs.getBinaryStream(1);
                 in.skip(pos);
                 int len = in.read(buff, off, length);



Mime
View raw message