Simply put, the XMLUI and JSPUI have opposite behavior when it comes to any uncommitted database changes (from any previous requests).
In the XMLUI, any uncommitted database changes are automatically committed by a "completeContext()" call in DSpaceCocoonServletFilter. This commit is made on EACH REQUEST to XMLUI, as it sits in a "finally()" clause within this ServletFilter:
(MINOR UPDATE: Looking more closely at the code, XMLUI will "abort" any uncommitted changes when an error occurs...see earlier "catch()" clauses which call "abortContext()". But, as long as an error did not occur, then uncommitted changes will be auto-committed.)
In the JSPUI, any uncommitted database changes are aborted (discarded) by a "context.abort()" call in the DSpaceServlet (which is inherited by all JSPUI servlets). This abort is made on EACH REQUEST to JSPUI, as it sits in a "finally()" clause within this Servlet:
This difference in behavior seems very odd, as it causes issues like
DS-2012 to appear in JSPUI but NOT in XMLUI. This issue was discovered by pbecker, peterdietz & I as we dug deeply on DS-2012 on why the "last_active" field is always updated for logins via XMLUI but never updated for logins via JSPUI. This behavior difference is the reason why DS-2012 occurs.