jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Node creation and querying in one transaction?
Date Mon, 25 May 2015 21:04:04 GMT
Not that I am aware of, the JCR spec defines that search index _can_ be available right _after_
a session.save() (depending on the repository implementation, Jackrabbit will usually do full
text indexes asynchronously for performance reasons). But having it available before the save
is not possible.

This would be quite a costly behaviour, as every method call (node.add etc.) would need to
update the index, and you'd need a separate index for every transient session.

I'd try to make your app work using navigational access, as that would work fine on a transient
session. Or you combine search results (all existing persisted stuff) and the changes you
made in the current session (you should know them at this point).

Cheers,
Alex

> On 22.05.2015, at 06:24, Kevin Pfaff <kevin.pfaff@byteconsult.de> wrote:
> 
> Hi,
> 
> we are trying to add transactions into our application. But we found a use case we could
not find a solution for.
> 
> Environment:
> Tomcat 7
> Spring 3.2.13
> Springmodules 0.8
> Jackrabbit 2.10.1
> 
> Someone had the same problem http://jackrabbit.510166.n4.nabble.com/Problems-with-XPath-query-no-result-td519373.html,
we are creating and querying nodes in one transaction.
> The query is implemented with xpath.
> Our application is often creating a node, querying all nodes from the type of the created
one and updating another node.
> This all happens in one single Transaction because an exception in the update should
also rollback the creation (new node might be corrupted).
> This is also the reason why we wanted to integrate transactions in our application.
> 
> Is there a possible way to query on all current nodes (transient space and persistent
space)?
> 
> We also tried JCR_SQL2 and JCR_QOM with the same result (result is missing the new node)
> 
> Thanks and Regards,
> Kevin


Mime
View raw message