This is a question regarding thread-safety of the Play Framework.
For a project I’ve got a large POJO containing static domain logic which is built during startup cycle. This is put in then put in a cache.
Each client uses this application scoped resource to ‘compute’ some specific values.
Will my application scoped resources be thread-safe as with the Controllers? Or do I have to implement thread-safety myself to avoid race-condition?
Thanks in advance!
Richard
You can put it into the cache, but it could be that the cache throw your data away. So it doesn’t look like a good idea. You must make sure that you can reinit the cache. The reinit must be thread-safe.
The cache is thread-safe. So as long as you only put thread-safe-objects into the cache every thing would be ok.
Hope this helps.