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

Query not thread safe

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.14.0
    • Jena 3.15.0
    • ARQ
    • None

    Description

      Executing the same query object on different RDFConnections is not thread safe:

      I ran into very misleading "NPE in NodeFactory.createLiteral" exceptions when computing SHA256 sums in parallel on different connections backed by different datasets/models using the SAME query object.

      I identified the cause as due to a race condition due to the digestCache used in ExprDigest

      My first question is: Are Query objects - or rather expressions - supposed to carry execution state or is this rather a bug?

      I know that some parts of the Query object, such as result vars, are only initialized on request which makes use of the same Query object in different threads fragile to begin with.
      So my other question is: Given a Query object, is Jena supposed to allow for 'fully initializing' it, such that its execution using Jena's provided facilities (models, datasets, etc) is guaranteed to not modify its state?

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              Aklakan Claus Stadler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m