Description
Entity manager can not be reused accross user requests, leading to some bugs, as reported by yeikel93@gmail.com .
16:20:37.144 [WARN ] o.a.j.m.p.IMAPServerModule - ID=1559016790 Error while processing imap request: org.apache.openjpa.persistence.PersistenceException - Multiple concurrent threads attempted to access a single broker. By default brokers are not thread safe; if you require and/or intend a broker to be accessed by more than one thread, set the openjpa.Multithreaded property to true to override the default behavior.
We might consider setting the openjpa.Multithreaded environment variable.
Alternatively, we can ensure quota related code instanciate the manager on a per-request bases, as it is done everywhere else.