While setting up a TCP lateral I encountered an infinite loop (sending
an element to a peer, getting it back, putting it, sending it again...).
To resolve it I made the following change:


    public void handlePut( ICacheElement element )
        throws IOException
    {
        if ( log.isDebugEnabled() )
        {
            log.debug( "handlePut> cacheName=" + element.getCacheName() + ", key=" + 
element.getKey() );
        }

        // This was the following, however passing true in for updateRemotes
        // causes an a loop, since the element will the be sent to the sender.
        // Passing false in fixes things, but I'm not sure I understand all
        // the details yet.
        //
        // getCache( element.getCacheName() )
        //    .update( element, CacheConstants.REMOTE_INVOKATION );

        getCache( element.getCacheName() )
            .update( element, false );
    }

Does passing false (or LOCAL_INVOCATION) in there make sense? Things
work much better now (vs OutOfMemory errors)

-- jt


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to