AnsweredAssumed Answered

OnContentReadPlocy fires 4 times in the same thread

Question asked by zhuk on Apr 10, 2009
Hi,

I'm a novice and trying to implement document hit counter on Share and  I need both direct download links and flash preview were taking into account.
I tried to adopt solution similar to hit counter from SDK examples and it really works fine for direct download links.
But when I'm viewing documents details (page with flash preview), OnContentReadPolicy fires 4 times in the same thread, i.e. one request causes 4 separate read transactions.

I looked into BehaviourFilter.disableBahaviour that disables policy using ThreadLocal - but who is responsible for flushing ThreadLocal variables before returning a thread back to pool? Me, Alfresco or can I rely on Tomcat container?
Does anybody know any alternative solution to hit counter on Share?

Thanks in advance.

P.S: Developing on Alfresco Enterprise 3.0.0, Tomcat

Outcomes