jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torgeir.ve...@gmail.com>
Subject new atomicCounter support (OAK-2220)
Date Fri, 13 Nov 2015 04:40:27 GMT
Am trying to use the new atomicSupport feature, and am wondering if I'm
using it the correct way;

My counter is initialised with

Node counter = JcrUtils.getOrCreateByPath("/testCounter",
"oak:Unstructured", session);
if (counter.isNew()) {

then when fetching a new value

counter.setProperty("oak:increment", 1);
long value = counter.getProperty("oak:counter").getLong();

What happens if the same code is called from a different thread / session
after the session.save() but before the getProperty() call? Will the value
remain unchanged in this thread / session?


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