MODE-2670 Changes the implementation of the internal repository locking The new lock implementation uses a bare-bone AbstractQueuedSynchronizer implementation because in ModeShape's case locks have to be able to be unlocked from other threads than the owning threads (transaction rollbacks). The previous ReentrantLock implementation would obviously not work. This commit also changes the way the persistence stores deal with transactions: instead of holding onto the "current" transaction via a ThreadLocal variable, they will now rely on their internal mapping of tx ids. This is provided by ModeShape for each transaction. Therefore, thread-locality is no longer an issue.
The commit further changes some of the ways in which internal transactions are used during repository startup, making sure some operations are grouped and some - the preconfigured workspaces - are created up-front within a single transaction.
MODE-2664 Fixes various issues with SQLServer support The fixes include: * making sure CREATE and DROP table statements correctly detect existing objects * using correct syntax for DB locking * using the correct binary type for storing schematic documents