ThreadContext.get() / put() [message #1053680] |
Tue, 07 May 2013 04:39  |
Eclipse User |
|
|
|
In a previous scout release we used ThreadContext.get() and ThreadContext.putCustomValue() as a short living cache for EJB references. We now updated our code to scout 3.8 and the methods ThreadContext.get() and ThreadContext.put() are now deprecated. Till now, I have not found a matching replacement for this functionality. A comment on the deprecation annotation is missing.
I tried a mix of using ThreadContext.getHttpServletRequest().setAttribute() in cases where I have servlet request and custom ThreadLocal in cases where a ServerJob is used. Problem is that the ThreadLocal is not transferred to new initiated ServerJobs (without more customizing) and that I have to add at several places code to initiate and destroy the custom ThreadLocal reference.
Because of this I still use the deprecated put and get of ThreadContext.
Where do I place such a short living cache which is used in http requests and SeverJobs?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04724 seconds