Search code examples
jenasemantic-webowltdb

Locking only part of a dataset in Apache Jena TDB


I am making a web application which will store a .owl file in a Jena TDB. The TDB will be stored in memory on a server. When a user writes to the TDB, it seems like it will place a write lock on the entire TDB. Is there a way to lock only a part of the TDB, so other read/write transactions can proceed on unrelated data?


Solution

  • TDB supports ACID transactions per dataset, allowing one writer and multiple readers to run at the same time. TDB will sort out multiple writer requests (they get serialized). The application can have multiple threads active accessing TDB.

    There is no way to specifically lock part of the dataset.

    TDB in primarily a persistent (on-disk) store with a high degree of in memory caching.

    If you need multiple writers at the same time to different graphs, then consider having multiple datasets.