[ 
https://issues.apache.org/jira/browse/OAK-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839001#comment-13839001
 ] 

Tobias Bocanegra commented on OAK-1262:
---------------------------------------

bq. Is the observing session the same as the one doing the read? 

yes, the code looks something like this:

{code}
public void onEvent(EventIterator events) {
  // some calculations to figure out the changed paths
  ....

  // get the node that was modified from the same session that registered this 
listener
  Node node = this.session.getNode(modifiedPath);
  ....

  // read the content from the node
  boolean enabled = node.getProperty("enabled").getBoolean();

  // here the 'enabled' property still contains the old value.
}
{code}

* from manual testing, it seems only to occur on "slow" machines after a couple 
of tries.
* doing a {{session.refresh(false);}} just before fetching the node solves the 
problem.


> observation event is triggered but session sees old content
> -----------------------------------------------------------
>
>                 Key: OAK-1262
>                 URL: https://issues.apache.org/jira/browse/OAK-1262
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Tobias Bocanegra
>
> unfortunately there is not test case yet, but we see sometime the behavior 
> that an admin session gets an observation event of a modified property but 
> when reading the content still sees the old content.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to