[ 
https://issues.apache.org/jira/browse/JENA-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16457776#comment-16457776
 ] 

Andy Seaborne commented on JENA-1536:
-------------------------------------

{{QuadAccSink}} supports the execution of SPARQL Update. It is not designed for 
concurrent use. Parsing is single threaded.

This is especially important because {{rdfConnection.update}} should be inside 
a transaction if local.

A "connection" is an ordered set of SPARQL-related operations. Order is likely 
to matter to an application.

What implementation of {{RDFConnection}} is this?

Its javadoc says: `/** Accumulate quads into a Sink (including allowing 
variables) during parsing. */`
and parsing is single threaded.  Concurrent use is not in is design space.

> unsynchronized collection in jena.atlas.lib.SinkToCollection causes 
> ArrayIndexOutOfBoundsException
> --------------------------------------------------------------------------------------------------
>
>                 Key: JENA-1536
>                 URL: https://issues.apache.org/jira/browse/JENA-1536
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Base
>            Reporter: Christopher Johnson
>            Assignee: A. Soroka
>            Priority: Major
>         Attachments: AtlasSinkNonSynchronizedCollectionException.txt
>
>
> Attached is a stack trace that shows the issue. 
> [^AtlasSinkNonSynchronizedCollectionException.txt]
> This is produced by a repeated client test through
> {noformat}
> RDFConnection.update{noformat}
> via this [Trellis 
> method|https://github.com/trellis-ldp/trellis/blob/master/components/triplestore/src/main/java/org/trellisldp/triplestore/TriplestoreResourceService.java#L212-L227]
>  that streams quads quite fast.  
> Changing the method signature to this:
> {code:java}
> @Override
> public synchronized void send(T item) { c.add(item); }{code}
> Solves the problem for me.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to