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

REST API holds on to context for too long, should use DB pool

    XMLWordPrintable

    Details

    • Attachments:
      0
    • Comments:
      5
    • Documentation Status:
      Not Required

      Description

      REST API (Jersey), grabs a context, and never frees/returns/releases it. I don't know exactly what is going on, but it causes the REST API to not be able to reflect real-time updates to content.

      To repeat. Load a DSpace-REST result for some endpoint. Edit the title/name of the first object returned in that result. Reload the REST endpoint. For me, the REST response didn't have the updated title/name.

      Since the typical use-case of DSpace is content that rarely/never changes, this isn't a big deal, but it needs to be resolved.

      I believe this bug got in during the performance stress-testing process, where after hitting DSpace REST with millions of requests to Communities, Collections, Items, Bitstream over the span of an hour, I had added changes to help REST spend less time dealing with database connections, and instead keep a connection.

      The better route would be to grab a database connection from the pool, and return the connection back to the pool once the request is complete. I think I/we need to take a look at database connection pool best practices.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterdietz Peter Dietz
                Reporter:
                peterdietz Peter Dietz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: