This may be a non-issue for the ActivationInterceptor. Since transactions are only handled by JBossCache on remote nodes and evictions are never forwarded to remote nodes, it looks like the transaction code in the ActivationInterceptor will never be executed. I've tried various operations using transactions (inserts, removals, evictions) in a cluster and the interceptor's transaction code never seems to be invoked.
1) This is a possibility, although if the transaction doesn't commit should we count this? Then again, depending on the CacheLoader implementation, maybe we should count this - JDBC cache loaders actually make JDBC calls during the prepare phase, and then call a commit() on the JDBC connection when cacheloader.commit() is called. So these operations should really be counted.
2) You're right, this is not reasonable.
3) Hmm, don't like this - will break a lot of custom CacheLoaders out there.
4) Again a possibility.
Implemented in ActivationInterceptor and CacheStoreInterceptor using option 4 (counting in prepare phase, retrieving count and incrementing statistic during commit phase)