WorkspaceImpl workspace = context.getWorkspace();
XAItemStateManager stateMgr =
(XAItemStateManager) workspace.getItemStateManager();
XALockManager lockMgr =
(XALockManager) workspace.getInternalLockManager();
InternalXAVersionManager versionMgr =
(InternalXAVersionManager) getInternalVersionManager();
/**
* Create array that contains all resources that participate in this
* transactions. Some resources depend on each other, therefore you
* should only change the sequence if you know what you are doing!
*
* There are two artificial resources on the version manager (begin and
* end), which handle locking of the version manager. The begin resource
* acquires the write lock on the version manager in its prepare method,
* while the end resource releases the write lock in either commit or
* rollback. Please note that the write lock is only acquired if there
* is something to commit by the version manager.
* For further information see JCR-335 and JCR-962.
*/
txResources = new InternalXAResource[] {
versionMgr.getXAResourceBegin(),
versionMgr, stateMgr, lockMgr,
versionMgr.getXAResourceEnd()
};
stateMgr.setVirtualProvider(versionMgr);
}