GitHub user afs opened a pull request: https://github.com/apache/jena/pull/108
JENA-1085: Copmmon pattern for transaction lifecycle. Always call down to index operations. (Cleaned version of PR #107) This revision * Puts the transaction finalization code inside the commit/abort code that takes the system lock. This mean the lock is taken once at the finishing of a transaction. * Reorganises the code to a rigid pattern for operations. * Renames commitLock as systemLock * Uses ReentrantLock, not ReentrantReadWriteLock (only the write lock was used; the implement of a ReentrantReadWriteLock.WriteLock and ReentrantLock is much the same for our usage, just calls to the sync object). As well as code review, design review would be appreciated. Compared to the original design, this makes abort take a lock and call abort on indexes whereas previously it simply did nothing, knowing the index implementations would cope. Because abort is a not a performance critical operation (usually!), the symmetric and explicit calls to index operations makes things clearer in my view. 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/108.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 #108 ---- commit e5dc2f801e83682d4ab6c73f7a48da7b22aca43d Author: Andy Seaborne <a...@seaborne.org> Date: 2015-12-12T21:57:19Z JENA-1078: Silence warnings. commit 393d9714df62e9da4d999c5c87aaee7a83d41a59 Author: Andy Seaborne <a...@seaborne.org> Date: 2015-12-12T22:03:54Z JENA-1085: change commitLock to systemLock. Use fixed code pattern. * Reorganise code to use the same pattern for operations * Always call indexes with transaction lifecycle operations * Rename commitLock as systemLock * Use ReentrantLock, not ReentrantReadWriteLock ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---