You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Thomas Auinger <t....@byteconsult.de> on 2016/02/29 12:02:25 UTC

Understanding Transactions in Oak

Hello,
 
we have an application that is using JCR (currently Jackrabbit 2) to persist a range of (interdependent) entities. Our service layer is quite complex with lots of stores and reads within a request.
 
Our requirements regarding transactions is two-fold:
1.       A rollback at any time within the request should reverse all saved changes so far
2.       Changes made within the request should be visible to service calls within the same request (e.g. if service A stores an object, then service B should be able to read/find that object within the SAME request)
 
While we managed to implement point 1 with classic Jackrabbit, we failed to implement point 2 and got feedback from the community that it's not possible due to the internal indexes not updating. Workarounds like remembering which objects changed etc. are not really feasible (due to duplication of query logic).
 
Two questions at this point:
1.       Does Oak provide support for both aspects detailed above?
2.       If yes, where are some code examples how to enable transaction management for Oak, ideally within a Spring(-Boot) scenario
 
Thanks a million
Tom