Michael Hartmeier wrote:

It's in doResolve. This method locks all parent folders and the resource
itself. The actual locking is done by the
  tlockManager.lock(currentResourceId, currentUriStr, lockType);
calls.

Well, yes, but I was missing this in storeObject and removeObject, only found locking in createObject and retrieveObject. Has it been it forgotten? Or is it I simply do not understand (most likely...)? I thought storeObject could look like this


    public void storeObject(Uri uri, ObjectNode object)
        throws ServiceAccessException, ObjectNotFoundException {

ResourceId resourceId = obtainResourceId(uri, object);
ObjectNode objectClone = object.cloneObject();
objectClone.setUri(resourceId.getUuri()); // switch to uuri
try {
tlockManager.lock(resourceId, uri.toString(), TLock.WRITE_LOCK);
} catch (TLockedException e) {
throw new ServiceAccessException(this, new ConflictException(uri.toString()));
}
super.storeObject(resourceId, objectClone);
}



and removeObject like that


    public void removeObject(Uri uri, ObjectNode object)
        throws ServiceAccessException, ObjectNotFoundException {

ResourceId resourceId = obtainResourceId(uri, object);
ObjectNode objectClone = object.cloneObject();
objectClone.setUri(resourceId.getUuri()); // switch to uuri
try {
tlockManager.lock(resourceId, uri.toString(), TLock.WRITE_LOCK);
} catch (TLockedException e) {
throw new ServiceAccessException(this, new ConflictException(uri.toString()));
}
super.removeObject(resourceId, objectClone);
}



Could you explain?


Thanks :)

Oliver



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to