7 Replies Latest reply on Mar 5, 2016 2:39 AM by Horia Chiorean

    Event.PROPERTY_CHANGED semantics

    Rustam Usmanov Apprentice

      Having WildFly 8.2.0 and ModeShape 4.5.0 I'm trying to observe changing properties of nt:resource node. I'm setting jcr:data and jcr:mimeType properties with same values they already have and calling a session.save(). So I guess that these properties were not changed. But corresponding listener detects that three properties changed - jcr:lastModified,  jcr:lastModifiedBy, jcr:mimeType:

       

      2016-02-24 09:34:11,962 DEBUG [org.jboss.as.config] (MSC service thread 1-5) Configured system properties:

      ...

      java.runtime.version = 1.7.0_80-b15

      ...

      12:22:37,026 DEBUG [org.modeshape.jcr.JcrObservationManager] (modeshape-event-dispatcher-3-thread-7) Processing change: Changed property {http://www.jcp.org/jcr/1.0}lastModified on node '5e31bb87505d64d3ca2ef8-9669-4dea-9134-958ddb16d4c4' at path /{}books/{}13/{httpwww.jcp.orgjcr1.0}content from:{http://www.jcp.org/jcr/1.0}lastModified = 2016-02-24T12:22:05.305+03:00 to:{http://www.jcp.org/jcr/1.0}lastModified =2016-02-24T12:22:36.967+03:00

      12:22:37,027 DEBUG [org.modeshape.jcr.JcrObservationManager] (modeshape-event-dispatcher-3-thread-7) Processing change: Changed property {http://www.jcp.org/jcr/1.0}lastModifiedBy on node '5e31bb87505d64d3ca2ef8-9669-4dea-9134-958ddb16d4c4' at path /{}books/{}13/{httpwww.jcp.orgjcr1.0}content from:{http://www.jcp.org/jcr/1.0}lastModifiedBy = admin to:{http://www.jcp.org/jcr/1.0}lastModifiedBy = admin

      12:22:37,027 DEBUG [org.modeshape.jcr.JcrObservationManager] (modeshape-event-dispatcher-3-thread-7) Processing change: Changed property {http://www.jcp.org/jcr/1.0}mimeType on node '5e31bb87505d64d3ca2ef8-9669-4dea-9134-958ddb16d4c4' at path /{}books/{}13/{httpwww.jcp.orgjcr1.0}content from:{http://www.jcp.org/jcr/1.0}mimeType = application/xml to:{http://www.jcp.org/jcr/1.0}mimeType = application/xml

      When JRE is switched to 1.8, listener detects that two properties changed - jcr:lastModifiedBy, jcr:data:

       

      2016-02-24 13:17:47,196 DEBUG [org.jboss.as.config] (MSC service thread 1-7) Configured system properties:

      ...

      java.runtime.version = 1.8.0_72-b15

      ...

      13:18:28,534 DEBUG [org.modeshape.jcr.JcrObservationManager] (modeshape-event-dispatcher-3-thread-7) Processing change: Changed property {http://www.jcp.org/jcr/1.0}lastModified on node '5e31bb87505d64612b8e51-3ee4-4564-be23-4374c29faf69' at path /{}books/{}14/{httpwww.jcp.orgjcr1.0}content from:{http://www.jcp.org/jcr/1.0}lastModified = 2016-02-24T13:17:18.054+03:00 to:{http://www.jcp.org/jcr/1.0}lastModified = 2016-02-24T13:18:28.450+03:00                                                                                                                                         

      13:18:28,536 DEBUG [org.modeshape.jcr.JcrObservationManager] (modeshape-event-dispatcher-3-thread-7) Processing change: Changed property {http://www.jcp.org/jcr/1.0}data on node '5e31bb87505d64612b8e51-3ee4-4564-be23-4374c29faf69' at path /{}books/{}14/{httpwww.jcp.orgjcr1.0}content from:{http://www.jcp.org/jcr/1.0}data = binary (3,11KB, SHA1=67f9dfbaeb1d6968209dbfbc8fa801999f4f0b46) to:{http://www.jcp.org/jcr/1.0}data = binary (3,11KB, SHA1=67f9dfbaeb1d6968209dbfbc8fa801999f4f0b46)

       

       

      I agree that jcr:lastModified changed automatically when session was saved. But why jcr:lastModifiedBy, jcr:mimeType and jcr:data considered changed? More generally what is the semantics of "property change" as implemented in ModeShape? Should this semantics be independent of JRE version?