3 Replies Latest reply on Nov 3, 2005 9:21 AM by Martin Isheim

    Notification for removeData() calls

    Martin Isheim Newbie

      1) Calling removeData() for a node, which contains data, i get a NodeVisited notification. Instead i would expect a NodeModified notification
      (And now one NodeModifiy-Before and one NodeModify-After notification).

      2) Calling removeData() again (now the node has no more data), again
      a NodeVisited notification occurs. Here i would expect no notification at all,
      since no "modification" happend, especially no NodeModified or NodeModify notification.
      Here you can argue that TreeCache can't suppress all notifications,
      where the resulting data is "identical" to the data at the beginning,
      so applications must always be able to handle such situations. But where TreeCache can easily skip such notifications, it should do so, to reduce overhead.

      I'am now using standalonf JBossCache 1.2.4 with BEA weblogic.

        • 1. Re: Notification for removeData() calls
          Ben Wang Master

          Are you running your op under a transaction? Currently, our notification does not distinguish the transaction context yet.


          • 2. Re: Notification for removeData() calls
            Martin Isheim Newbie

            Yes, I'am using Transactions. But the direct notification within the transaction is not my problem.

            With the JBossCache, i now have to distinguish a "VisitedNotification", which indicates a Modification, from another, say normal, "VisitedNotification" which indicates a read access.

            Now i debugged into the JBossCache-Sources (thanks for including them into the download!) and i found following snipped in method _removeData.
            I don't understand the reason for the line, i marked with ">>>": Why sending "NodeVisited" as normal notification? I would expect "NodeModified", which is in the "else"-block.

            public void _removeData(GlobalTransaction tx, Fqn fqn, boolean create_undo_ops, boolean sendNodeEvent, boolean eviction)
            throws CacheException {

            notifyNodeEvict(fqn, true);
            notifyNodeModify(fqn, true);

            n.put(UNINITIALIZED, null); // required by cache loader to subsequently load the element again

            >>> if(sendNodeEvent) {
            else { // FIXME Bela did this so GUI view can refresh the view after node is evicted. But this breaks eviction policy, especially AOP!!!!
            if(eviction) {
            notifyNodeEvict(fqn, false);
            } else {
            notifyNodeModified(fqn); // todo: merge these 2 notifications back into 1 !
            notifyNodeModify(fqn, false);

            • 3. Re: Notification for removeData() calls
              Martin Isheim Newbie

              Sorry for asking again.
              Do you think, this is a bug?
              I found no according JIRA Issue, i thought i ask here before opening an JIRA Issue.