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

    Notification for removeData() calls

    martinluene

      Hello.
      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.
      Regards,
      Martin

        • 1. Re: Notification for removeData() calls

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

          -Ben

          • 2. Re: Notification for removeData() calls
            martinluene

            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.
            Regards,
            Martin

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

            [...]
            if(eviction)
            notifyNodeEvict(fqn, true);
            else
            notifyNodeModify(fqn, true);

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

            >>> if(sendNodeEvent) {
            notifyNodeVisited(fqn);
            }
            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) {
            notifyNodeEvicted(fqn);
            notifyNodeEvict(fqn, false);
            } else {
            notifyNodeModified(fqn); // todo: merge these 2 notifications back into 1 !
            notifyNodeModify(fqn, false);
            }
            }

            • 3. Re: Notification for removeData() calls
              martinluene

              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.