Cache: Coherence 220.127.116.11
Client: C++ (Coherence 18.104.22.168)
We have a cache of "states" (one entry for each of the four things we're interested in in our system).
On the Java side we extend AbstractProcessor. This is invoked to handle inserts/updates to the states in the cache.
On the C++ (client) side we have a continuous query which "listens" for updates to the state.
When I fiire state changes the Java processor "process" method is invoked (which is fine). I debug through it and it does its job - no exceptions and no NULL pointers.
h1. The Problem
When the Java "process" method completes my C++ client onMapEvent method is invoked.
Calling vEvent->getNewValue() gets the correct new value. Calling vEvent->getOldValue() always returns null. We never get the old state even though state exists in the cache before the update.
Does anyone know why the old value is not being set?
h2. Java (pseudo code)
public Object process(Entry entry)
// Some logic...
ProdState newState = new ProdState(/*New values*/);
A couple of questions.
1) Can you post a snippet of code calling your EntryProcessor? Is it called from Java or C++?
2) In your EntryProcessor, are you able to try the following instead of creating a new ProdState() object.
ProdState prodState = (ProdState) entry.getValue();
// Call setters to change values for prodState.
3) Are you sure you are updating the same key for the ProdState object?
Have you tried replacing the CQC with a near-cache, or even attaching the listener directly to the grids distributed cache? This might help to isolate your issue, as it may be purely CQC related. If all three result in the same issue its much more likely to be the EP.
Perhaps the ContinuousQueryCache constructor is registering the listener in "lite" mode (see method addFilterListener in http://docs.oracle.com/cd/E24290_01/coh.371/e22845/classcoherence_1_1util_1_1_observable_map.html).
To verify, trying explicitly adding a listener using addFilterListener setting "fLite" to false.
It may not be useful as a solution to your problem, in that adding the listener afterwards means you'll miss the events arising from initial population of the CQC, but may at least clarify what's happening.