I think that the second pattern "create a dataset object on the thread", or
rather in my case
"create a dataset object for one HTTP request"
is worth trying.

And I want to know why the doc seems to prefer the first pattern.

2016-02-03 18:30 GMT+01:00 A. Soroka <aj...@virginia.edu>:

> > On Feb 3, 2016, at 5:13 AM, Jean-Marc Vanel <jeanmarc.va...@gmail.com>
> wrote:
> >
> > In the documentation,
> >
> >
> https://jena.apache.org/documentation/tdb/tdb_transactions.html#multi-threaded-use
> >
> > it is not clear which use pattern is preferred and the reason why.
>
> The first pattern shows a single dataset object being shared between
> threads, each of which operates a transaction against that object, and the
> second pattern is introduced with "or create a dataset object on the thread
> (the case above is preferred):”.
>
> As to why, I am not familiar enough with TDB to be sure, but there is a
> comment on the second pattern "Each thread has a separate dataset object;
> these safely share the same storage but have independent transactions.”
> that would seem to indicate that the second pattern is vulnerable to having
> conflicts between transactions opened against the two different dataset
> objects.
>
> ---
> A. Soroka
> The University of Virginia Library
>
>
> > On Feb 3, 2016, at 5:13 AM, Jean-Marc Vanel <jeanmarc.va...@gmail.com>
> wrote:
> >
> > I have a repeating memory leak in TDB in my web application (
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms_play/README.md
> > ).
> > It is caching RDF documents from internet, typically dbpedia ressources.
> >
> > It is not the use case described in "Fuseki/TDB memory leak for
> concurrent
> > updates/queries" https://issues.apache.org/jira/browse/JENA-689 , as the
> > journal is empty after crash .
> >
> > A single Dataset object is used for the duration of the application, and
> I
> > suspect this is the root cause.
> > In the documentation,
> >
> >
> https://jena.apache.org/documentation/tdb/tdb_transactions.html#multi-threaded-use
> >
> > it is not clear which use pattern is preferred and the reason why.
> >
> > You someone confirm that keeping a single Dataset object for the duration
> > of the application is bad ?
>
>


-- 
Jean-Marc Vanel
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
http://deductions-software.com/
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui

Reply via email to