Details
-
Question
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 3.14.0
-
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
- relates to
-
JENA-1889 QueryTransformOps.transform is sensitive to the internal state of a query.
- Closed