NCache 4.6 - Online Documentation

How does Entry Processor Work?

Entry Processor can be executed on a single cache entry or a set of cache entries in NCache. It is particularly useful if you are to perform bulk processing over your items.
Once you invoke your EntryProcessor to be executed on the server side, the data is modified accordingly in the cache server. Using Entry Processors, you do not have to worry about concurrency as it applies a low-level lock on the cache items it is processing. In case the required entry is locked by the client, EntryProcessor can ignore the lock and access it.
This feature has just one component- the EntryProcessor.
This component contains the actual implementation of the code you want to be executed against the cache entries. Make sure that the class you implement is Serializable, along with any parameters the process code might be taking in.
Entry Processors work in parallel across the cluster, on the nodes that contain the entries. This helps in reducing a significant amount of network burden as the extra trips of fetching data to execute the code and saving it back to the cache is eliminated.
The values may be changed or removed and it is up to you how you treat the resultant data:
·     Fetch the data without saving the change in the cache and use it in your application locally.
·     Save the modification in the cache.
·     Update the modification in both the cache and data source through ReadThru and WriteThru operations.
Make sure that the EntryProcessor class which you implement and the resultant values are Serializable before any operation takes place.
See Also