jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luiz Fernando Teston <feu.tes...@caravelatech.com>
Subject question about xpath on not saved nodes
Date Fri, 27 Nov 2009 15:46:14 GMT
I'm a core developer of a project that uses JCR a lot. We are using
JackRabbit as our implementation and it works very well for us on a lot of
I don't know if I did something wrong, but this is what happens on my
Working on the same opened Jcr Session, I just added a node and tried to
retrieve it using xpath. It doesn't retrieve its node. But if I save this
node before doing the xpath it works.
I don't know, but on sql inside a transaction, after doing an insert is
possible to retrieve the new row on the same transaction. I think it should
behave the same way on a new node inside a given session.
So, I have a question: Is it possible to change this behavior to be possible
to retrieve this nodes before saving? (of course only on the current
session). Maybe it should be possible to change this behavior by modifying
the repository.xml or something like that.

Here is the code used inside the test:

                 //opens a session...
                Node rootNode = session.getRootNode();
session.save(); //if this line is commented the result of hasNext is false.
Otherwise is true
       QueryResult result = XPathTest.session.getWorkspace()
.getQueryManager().createQuery("abc", Query.XPATH).execute();
boolean hasNext = result.getNodes().hasNext();

Before send this email I also looked for it on google and jackrabbit site,
but I didn't find anything.
So, I appreciate if you guys can help me.

Best regards,

Fernando Teston

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message