Very impressive -- you're right!
We just compared ParentStore with our proprietary implementation:
ParentStore has to lock upon store and remove! Somehow, the appropriate
call got lost.
It probably doesn't cause problems in the testsuite because 1) there are
retrieveObject calls with proper locking before storeObject calls, and
2) the parent folder will always be locked before removeObject is
called.
Peter just tries a patch on his machine, it shouldn't be too difficult.
We're still discussing a possible problem with the resolve cache, but
that's independent from the above bug.
Michael
On Tue, 2004-01-06 at 13:44, Oliver Zeigermann wrote:
> 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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]