How to Write Thread-safe Code with JAXB
The rules for JAXB in a multi-threaded environment are very simple: you can share the JAXBContext object among threads. Doing so will also improve performance, as the construction of the context may be expensive. All other objects, including Marshaller and Unmarshaller, are not thread-safe and must not be shared. The static helper methods in the JAXB class can be used from several threads, of course.
In practice, this means that if you need a JAXBContext instance, you should probably store in a static member.

