1) Yes. Only the RPC happens in a separate thread. The rest (locking, local update) all happens in the app thread.
2) No, order is not guaranteed. The async API is only recommended for unrelated entries. And yes, using a transaction or a batch would guarantee order, but then you would not need to use the async API. Just doing:
cache.startBatch(); cache.put(k1, v1); // will return immediately, will not wait for RPC cache.put(k2, v2); // will also return immediately cache.endBatch(true); // will push the replication for the above PUTs in a single RPC message
thanks a lot!
this clarifies the usage and perfectly solves my needs.
I'm going to throw away transactions, as Lucene doesn't have this concept and it was making things unnecessarily complex.