sparql-client icon indicating copy to clipboard operation
sparql-client copied to clipboard

Mixing `query` and `update` calls is not thread safe when using a single client instance

Open msalvadores opened this issue 12 years ago • 1 comments

One could run into race condition issues when having one client used by multiple threads to run query and update calls. This is due to the use of instance variables in the make_post_request method:

request['Content-Type'] = 'application/sparql-' + (@op || :query).to_s

https://github.com/ruby-rdf/sparql-client/blob/master/lib/sparql/client.rb#L505

msalvadores avatar Apr 13 '13 19:04 msalvadores

Thanks for reporting. I'm not sure that the client is otherwise thread-safe, though; it's encapsulating a single HTTP connection, after all. Will evaluate whether it makes any sense to define it as thread safe when we get around to the next release.

artob avatar Apr 13 '13 22:04 artob