You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Nadkarni, Krishnapratik (GE Global Research)" <Kr...@ge.com> on 2014/09/17 22:16:31 UTC

Concurrency Issues

Hi,

I am trying to use Jena Reasoner api with multiple threads in java. I use a Reasoner per thread instance. I am still getting exceptions like ‘ConcurrentModificationException’ at times. Some times I also get ‘predicate cannot be null’ when I actually try run a Sparql query against my RDF data store use Jena api.

Can you please let me know if there are any known issues with use the Jena api in a multithreaded environment?

Regards,
Pratik

Re: Concurrency Issues

Posted by - <ja...@gmx.de>.
Hi Pratik,

are you sure that the multi-threaded setup is correct? I remember having
problems once with pellet reasoner and jena. In my scenario multiple
threads were trying to read a shared model and although jena itself is
thread-safe wrt multiple reading threads pellet is not. The pitfall here
was the initialization of pellets internal knowledge base which isn't
thread-safe. Once the knowledge base is initialized (and the underlying
model doesn't change) all reads are thread-safe again.

Best regards,
Tobias

On 09/17/2014 10:16 PM, Nadkarni, Krishnapratik (GE Global Research) wrote:
> Hi,
> 
> I am trying to use Jena Reasoner api with multiple threads in java. I use a Reasoner per thread instance. I am still getting exceptions like ‘ConcurrentModificationException’ at times. Some times I also get ‘predicate cannot be null’ when I actually try run a Sparql query against my RDF data store use Jena api.
> 
> Can you please let me know if there are any known issues with use the Jena api in a multithreaded environment?
> 
> Regards,
> Pratik
> 


Re: Concurrency Issues

Posted by Andy Seaborne <an...@apache.org>.
On 17/09/14 21:16, Nadkarni, Krishnapratik (GE Global Research) wrote:
> Hi,
>
> I am trying to use Jena Reasoner api with multiple threads in java. I
> use a Reasoner per thread instance. I am still getting exceptions
> like ‘ConcurrentModificationException’ at times. Some times I also
> get ‘predicate cannot be null’ when I actually try run a Sparql query
> against my RDF data store use Jena api.
>
> Can you please let me know if there are any known issues with use the
> Jena api in a multithreaded environment?
>
> Regards, Pratik
>

None are known - the APIs should be concurrent-read safe.

Which version are you using?
What is the runtime environment (OS, JVM version)?

Could you provide a complete, minimal example please?

	Andy