GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/109
Introduce interface TransactionalComponent.
Mantis has a more general concept of transaction. As part of that, it
differentiates between `Transactional` (the view from users of a transaction
system) and `TransactionalComponent` (units of code that participate in
providing transactionality).
See [the code for
TransactionalComponent](https://github.com/afs/mantis/blob/master/dboe-transaction/src/main/java/org/seaborne/dboe/transaction/txn/TransactionalComponent.java)
-- for example, that has a explicit `Transaction` object and only the upper
layers manage the `Transaction` by thread.
For the in-memory dataset, the difference is currently small but
introducing this now prepares for more complex setups, without disturbing
`Transactional`. It also removes the need for components to know whether they
are in a transaction or not; that is a concept of the coordinator function
currently in `DatasetGraphInMemory`. During times of state change, some
components may be in different states to others, making the idea of a component
being "in a transaction" imprecise. It also removes 11 ThreadLocals that were
not used except in testing. The testing is adapted.
To use individual components on their own (if ever needed) then a simple
wrapper that provides `Transactional` over a single component is a better
design as it separates the roles of collection and component. Included is
`TransactionalOfOne` but that is just illustrative and not for inclusion.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena txnmem
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/109.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #109
----
commit 39cf986fee9347c1920354b3fbddfed298bee8be
Author: Andy Seaborne <[email protected]>
Date: 2015-12-14T12:47:24Z
Use counting inside and outside a transaction to see what's happened.
commit a086675b27d0875126493bdd9f1e4247b87a2bb2
Author: Andy Seaborne <[email protected]>
Date: 2015-12-14T12:48:18Z
Introduce interface TransactionalComponent.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---