Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2072

XMLUI always commits any uncommitted changes while JSPUI always discards any uncommitted changes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: More Details Needed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.0, 1.8.1, 1.8.2, 1.8.3, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2
    • Fix Version/s: None
    • Component/s: JSPUI, XMLUI
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      6
    • Documentation Status:
      Needed

      Description

      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:
      https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceCocoonServletFilter.java#L294
      (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:
      https://github.com/DSpace/DSpace/blob/master/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/DSpaceServlet.java#L156

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tdonohue Tim Donohue
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: