The TreeCacheProviderHook is the correct one to use with EJB3. Unfortunately due to a bug in the hook it only works with a pessimistically locked cache (hence the errors you see).
This has been fixed in the next JBoss AS release, let me check if it is available as a part of the next EJB3 release as well.
This was fixed as part of EJB3 RC9 Patch 1.
You should be using TreeCacheProviderHook which, from this release, works for both Optimistic and Pessimistic locking JBoss Cache instances.
No, the optimistic support was added after EJB3 RC9 Patch 1. :(