3 Replies Latest reply on Oct 8, 2015 10:11 AM by mark.k

    RemoteCache always returns null

    mark.k

      I have a problem I've been unable to solve. Basically, my RemoteCache always returns a MarshalledValue and its get() always returns null. The MarshalledValue receives a stream of bytes that is over 1000 bytes, but the value is always null. The prior check to determine if the key is in the cache returns true, and in the server log, I can see that the model is being serialized for the client in the server log. I am unable to determine why the MarshalledValue always returns null when the object is is received by the client (or so it seems).

       

      Attached are two TRACE logs (client and server) and the infinispan.xml config we use. We are on Infinispan 7.2.5, though I also tested with 6.x and had same results. We have Compatibility mode enabled and Store-As-Binary.

       

      Thanks,

      Mark.

        • 1. Re: RemoteCache always returns null
          mark.k

          Just to add to this, if I disable the store-as-binary setting, I get a value back at the RemoteCache. I would like to use store-as-binary because then we don't need to worry about modifying in-cache values during an operation until the put. How do we get both working together?

           

          Thanks,

          Mark.

          • 2. Re: RemoteCache always returns null
            galder.zamarreno

            I think the issue you are seeing is a bug. Could you create an Infinispan JIRA via JBoss Issue Tracker and add all the information there?

            I would like to use store-as-binary because then we don't need to worry about modifying in-cache values during an operation until the put

            ^ Based on this info, I assume you are accessing the same cache via Remote Cache and embedded cache as well? Although your use case is valid, and in fact we use storeAsBinary setting as a way to enable cache-by-value for JCache, my recommendation would be to switch it off since it has an added cost in terms of performance to switch backwards/forwards between object and byte array format.

             

            An alternative way to avoid users modifying in-cache values would be to make the cached values effectively immutable. Trying to keep immutable data can involve extra memory since modifications are made by creating new instances which include final state.

             

            Cheers,

            Galder

            • 3. Re: RemoteCache always returns null
              mark.k

              Yes, we are using both embedded and remote cache managers. Our application cluster runs the embedded caches, and we have clients/tools that access that cluster over HotRod. We have large device configurations stored in the cache which must be modified atomically, and so we were depending on the store-by-value to prevent in-cache mutation.

               

              I will create a bug for this.

               

              Thanks

              Mark.