I think the InvocationContextInterceptor should clean up the thread local entry as the
invocation exits.
The only place this causes a problem is if there is a callback (like you said, with the
notifier) and this triggers another cache operation which ends up resetting the thread
local entry. This is less of a problem now since interceptors don't rely on the
thread local once the call goes past the ICI (the IC is passed as a param). It is also
less of a problem since (JBCACHE-1022) all notifications will now be emitted from the
NotificationInterceptor, after which there is not much more than cleanup work remaining.
I think having the ICI clean up thread locals explicitly is more robust and maintainable
than weak refs or calling code holding on to refs.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052530#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...