In createService(), TreeCache set Channel.AUTO_GET_STATE to true. This should only be done if the cache is configured to do an initial state transfer.
That's easy to fix. What's harder to fix is what to do when region-based marshalling is in effect. Probably, something like the following:
1) In viewAccepted, monitor for the case where a view is issue that doesn't include the current node. Set a flag and ??? (throw exceptions when attempts are made to use the cache???)
2) When another view is accepted that once again includes the current node, iterate through the various marshalling regions, inactivating and then reactivating them (reactivation will cause a partial state transfer).