[
https://issues.apache.org/jira/browse/OAK-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13529105#comment-13529105
]
Thomas Mueller commented on OAK-343:
------------------------------------
This is a very interesting approach. It should work and is quite elegant. The
query is actually executed in the getCost method, that's a bit outside of what
I thought getCost should do, but I'm sure we can solve that (either change
documentation or change the behavior a bit).
Maybe we could use a similar mechanism for other problems as well, for example
to allow other queries to see the latest (transient) state of the repository,
even if the index implementation itself doesn't support that directly. This is
a feature quite commonly requested, but is relatively hard to solve in another
way. But there is a cost to it (even if it's only in-memory operation), so I
guess it shouldn't be done by default. Maybe with an extension in the query
syntax? ("select ... including transient" or so) Instead of 'only' using this
special transient index, I wonder if the normal index and the transient index
should be combined, so that the query doesn't need to be executed in getCost. A
similar mechanism to overlay / combine indexes is already used in the NodeType
index, and one is planned to speed up queries of type "a=1 and b=2". I will
propose a solution for that, but I guess it's not urgent.
> Session.getNodeByUUID requires save call
> ----------------------------------------
>
> Key: OAK-343
> URL: https://issues.apache.org/jira/browse/OAK-343
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, jcr
> Reporter: angela
> Attachments: oak-343.patch
>
>
> while adding mix:referenceable to a new node immediately assigns a
> uuid and makes the node referenceable, session.getNodeByUUID only works
> after saving the changes.
> the following test illustrates this behavior:
> @Test
> public void getNodeByUUID() throws RepositoryException {
> Node node = getNode("/foo").addNode("boo");
> node.addMixin(JcrConstants.MIX_REFERENCEABLE);
> assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
> String uuid = node.getUUID();
> assertNotNull(uuid);
> assertEquals(uuid, node.getIdentifier());
> Node nAgain = node.getSession().getNodeByUUID(uuid);
> assertTrue(nAgain.isSame(node));
> assertTrue(nAgain.isSame(node.getSession().getNodeByIdentifier(uuid)));
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira