Hi -
I'm assuming that the near-cache is client-side, but please confirm that.
When you evict a key from a map, the near-caches receive invalidation events. I see that you wouldn't expect this to happen during the write, but it's possible as there's a write delay. The invalidation happens on the owning member first and is propagated to the other members and clients.
If the write is initiated on a client and the client sees the null key, we should look at your near-cache configuration. There are options for controlling the behavior. If you're using "INVALIDATE", the key should be removed from the near cache as soon as you begin the write and before it completes on the server If you were using "CACHE_ON_UPDATE", the key should be retained in the near-cache until the eviction message is received.
Beyond that, I'd like to understand why you evict it when you write to the database. Clearly, you may have some backend processing (i.e. triggers or streams) that changes the data. If this were the case, the evict would cause the client to see a new image of that key on the next get. Is this the case? If there is no backend processing, would leaving it in the cache to expire normally be an option?
Thanks
Tom