2.2.2. Lock Manager configuration

What LockManager does?

In general, LockManager stores Lock objects, so it can give a Lock object or can release it. Also, LockManager is responsible for removing Locks that live too long. This parameter may be configured with "time-out" property.

JCR provides one basic implementations of LockManager:


org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl 

CacheableLockManagerImpl

ISPNCacheableLockManagerImpl stores Lock objects in Infinispan, so Locks are replicable and affect on cluster, not only a single node. Also, Infinispan has a JdbcStringBasedStore, so Locks will be stored to the database.

You can enable LockManager by adding lock-manager-configuration to workspace-configuration.

For example:


<workspace name="ws">
   ...
   <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
      <properties>
         <property name="time-out" value="15m" />
         ...
      </properties>
   </lock-manager>               
   ...
</workspace> 

Where time-out parameter represents interval to remove Expired Locks. LockRemover separates threads, that periodically ask LockManager to remove Locks that live so long.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus