Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-120

Query objects with aggregators cannot be reused

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Done
    • None
    • Jena 2.11.0
    • ARQ
    • None

    Description

      Query objects that contain aggregators (Group By) cannot be reused by different threads because the internal state is mutable. Even reusing a query object in the same thread has problems, because it creates a new Aggregator object each time you execute the query. Users may want to reuse Query objects to save having to reparse the query string.

      I believe the solution is to copy the aggregators when compiling the query. I've attached a patch that does that in the AlgebraGenerator.compileModifiers() method.

      See the thread at [1] for more discussion.

      [1] http://mail-archives.apache.org/mod_mbox/incubator-jena-users/201109.mbox/%3CB60ACA3A-DB31-4FEC-A72E-D81A5C2AB41A@knublauch.com%3E

      Attachments

        1. JENA-120-r1173178.patch
          3 kB
          Stephen Allen
        2. JENA-120-r1173729.patch
          5 kB
          Stephen Allen
        3. JENA-120-r1173738.patch
          5 kB
          Andy Seaborne
        4. JENA-120-r1173738.patch
          5 kB
          Stephen Allen
        5. JENA-120-r1174346.patch
          31 kB
          Andy Seaborne

        Issue Links

          Activity

            People

              andy Andy Seaborne
              sallen Stephen Allen
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: