Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-1785

Jersey session injection fails with invalid transaction ids

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Fedora 4.4.0
    • Fix Version/s: Fedora 4.5.1
    • Component/s: f4-core
    • Labels:
    • Sprint:
      Sprint 2015 - 11, Sprint 2015 - 12, Sprint 2015 - 13

      Description

      Using jersey, the AbstractResource class expects to have a Session object injected into it. This injection fails, however, in the context of a transaction when that transaction ID does not exist. This is because the SessionFactory class throws a TransactionMissingException error, leaving the AbstractResource in an invalid state (at least as far as Jersey is concerned).

      That invalid state is circumvented by simply throwing a ClientErrorException and returning a 410 Gone response. This means that, from the perspective of a REST client, I see the correct behavior, but still the architecture is incorrect.

      This ticket should track the refactoring of how sessions are injected into the AbstractResource class so that TransactionMissingExceptions don't cause stacktraces like this: https://gist.github.com/acoburn/86d46e4d4322cfa08160

      This was generated while tailing the tomcat logfile and running this command:

      curl -i localhost:8080/fcrepo/rest/tx:fake/some-existing-resource

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                acoburn Aaron Coburn
                Reporter:
                acoburn Aaron Coburn
                Reviewer:
                Andrew Woods
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: