Class WorkerThreadBase

java.lang.Object
org.aksw.jenax.dataaccess.sparql.common.WorkerThreadBase
Direct Known Subclasses:
RDFLinkWrapperWithWorkerThread, TransactionalWrapperWithWorkerThread

public class WorkerThreadBase extends Object
Wraps an RDFLink such that all method calls originate from the same (worker) thread. Transactions in jena are per-thread rather than per-connection. This means, that if a main thread starts a write transaction on a connection and later a worker thread wants to perform a write on the same connection it results in a deadlock. This wrapper resolves the deadlock situation at the cost of processing any request from any thread made to the RDFLink sequentially in a single additional thread. Note that this class also wraps access to QueryExec, RowSet, etc such that it goes through the worker thread
Author:
raven
  • Field Details

  • Constructor Details

    • WorkerThreadBase

      public WorkerThreadBase()
    • WorkerThreadBase

      public WorkerThreadBase(ExecutorService es)
  • Method Details

    • submit

      public static <T> T submit(ExecutorService executorService, Callable<T> callable)
    • submit

      public void submit(Runnable runnable)
    • submit

      public <T> T submit(Callable<T> callable)