Hi, im integrating Docmosis into an JEE server application.
The documentation states in section 3.8
When an application is shutting down or no longer needs Docmosis, it should close
down Docmosis with the following call:
My question is, should I release between calls to Docmosis, or is it completely ok to keep the systemmanager open over long periods (basically months or even years).
On a similar note,
How thread-safe is Docmosis?
Regarding inialise/release, but also regarding clearing and populating the templateStore vs rendering.
Hello Tom.
It is correct to keep Docmosis intilised and running for as long as your application needs it. SystemManager.initialise() does a fair amount of work setting up Docmosis to render documents as fast as possible. Calling SystemManager.release() is an optional call to make sure Docmosis cleans up as much as it can before the application stops. We wouldn't recommend releasing between calls to Docmosis since that will only slow things down a fair amount.
With regards to concurrency issues, we don't expect applications to be calling SystemManager.initialise() and SystemManager.release() in concurrent fashion. Even so, initialise() and release() are static synchronised methods so you can be sure they are thread-safe. With regards to storing and rendering templates, if you attempt to put a new template into the store over the top of an existing one then the operation will fail with an exception (and a message indicating the template is being used). Docmosis ensures that a template can't be replaced or deleted whilst it is in use, but other than that there are no concurrency controls. If your application is likely to have contention between updating a template and rendering it, then let us know - Docmosis is always evolving and this is something that can be provided.
