Rythm can be used as a singleton or instantiated as a normal object.
Currently I instantiate it once in a webapp in the Servlet
First in the latest version of rythm, you should call
Now to answer your questions:
- Is this correct or is there no race condition?
It will NOT cause race condition because inside the code it uses
ThreadLocal to store the render settings
- Should I create a Rythm instance for each request?
- Is there another way to change the language for each rendering without changing the engine state?
Language and locale are NOT engine level states, they are per request states. However default language and locale could be configured at engine level