DSpace/DSpace — pull request #567 by peterdietz (2014-07-10 19:34:17+00:00)
Title: (For 4.x branch) DS-1986 REST to use new context for each request

This is the DSpace 4.x PR for DS-1986.
The other PR for DSpace 5.x/master is https://github.com/DSpace/DSpace/pull/561

This fixes: https://jira.duraspace.org/browse/DS-1986

Where previously REST had to cache org.dspace.core.Context, and hold it forever. Caching the context is bad, it causes stale data. Fixing this was easy, thanks for @RichardRodgers advice at OR2014, i.e. close the context in the finally.

I've JMETER tested all the rest methods after this change, and the performance is fine. I don't notice any issue with not caching the context, and the error rate is 0 as before.

This fix should apply to DSpace 4.x, in time for DSpace 4.2.