[Core, Locking]: Refactoring for supporting RestXQ
Merge pull request #687 from JensErat/visitor-locking

[Core, Locking]: Refactoring for supporting RestXQ
Merge branch 'master' into visitor-locking
[MOD] RESTXQ: database locking support