Hi all,

while working with Oak S3 DS I have witnessed slowness (no numbers, just
'slow' from a user perspective) in persisting a binary using its reference;
although this may be related to some environment specific issue I wondered
about the reference binary handling we introduced in JCR-3534 [1].
In fact the implementation there requires to do something like

ReferenceBinary ref = new SimpleReferenceBinary(referenceString);
Binary referencedBinary =
session.getValueFactory().createValue(ref).getBinary();
node.setProperty("foo", referencedBinary);

on the "installation" side.
Despite all possible issues in the implementation it seems this API
requires Oak to always retrieve the binary value from the DS and then store
its value into the node whereas it'd be much better to avoid having to read
the value but instead bind it to that referenced binary.

ReferenceBinary ref = new SimpleReferenceBinary(referenceString);
if (ref.isValid()) { // referenced binary exists in the DS
  node.setProperty("foo", ref, Type.BINARY); // set a string with binary
type !?
}

I am not sure if the above code could make sense, probably not, but at
least wanted to point out the problem as to seek for possible enhancements.

Regards,
Tommaso

[1] : https://issues.apache.org/jira/browse/JCR-3534

Reply via email to