try {
((PageContextImpl)pageContext).setActiveLock(new ActiveLock(type,name,timeoutInMillis)); // this has to be first, otherwise LockTimeoutException has nothing to release
data = manager.lock(type,name,timeoutInMillis,pageContext.getId());
}
catch (LockTimeoutException e) {
LockManagerImpl mi = (LockManagerImpl)manager;
Boolean hasReadLock = mi.isReadLocked(name);
Boolean hasWriteLock = mi.isWriteLocked(name);
String msg = LockTimeoutExceptionImpl.createMessage(type, name, lockType, timeoutInMillis, hasReadLock, hasWriteLock);
_release(pageContext,System.nanoTime()-start);
name=null;