[ 
https://issues.apache.org/jira/browse/JENA-244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Owens updated JENA-244:
-------------------------------

    Attachment: JenaDeadLockTest.java

I've attached an update to the test case that shows all three potential work 
arounds. All three seem to work. There are four tests in the attached, the 
ignored test is the failure case that shows the deadlock, the other three all 
succeed against the same thread use because they employ one of three work 
around strategies for the bug.

1) Do a 'warmup' query on the model before accessing it from multiple threads. 
This only works if you have a section of code that is thread safe running it 
and only if you don't subsequently change the model. The warmup query itself 
doesn't seem to matter. This has the advantage that you don't need to know if 
the model is inferencing or not to run it.

2) Do a 'prepare' on the model before accessing it from multiple threads. This 
also only works if you have a section of code that is thread safe running it 
and only if you don't subsequently change the model. This requires you to test 
the model to see if it is inferencing since the standard model interface 
doesn't support the prepare method.

3) Use forward instead of backward chaining when you create the inference 
model. Unless you need backward chaining for a specific reason this is the 
number one choice. As far as I know it doesn't matter if you subsequently 
change the model and this can be used without a thread safe starting point. 
Perhaps this should become the default behaviour for the convenience method 
that creates an RDFS model in the future? 

                
> Deadlock during SPARQL execution on an inference model
> ------------------------------------------------------
>
>                 Key: JENA-244
>                 URL: https://issues.apache.org/jira/browse/JENA-244
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>            Reporter: Stephen Owens
>         Attachments: JenaDeadLockTest.java, JenaDeadLockTest.java
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to