Opened 4 years ago

Closed 4 years ago

#2346 closed defect (fixed)

Load package failed with DBXML error: Document not found

Reported by: zhanga Owned by: Andy Zhang
Priority: medium Milestone: 2.6
Component: Resource Service Version: 2.5.0
Severity: minor Keywords:
Cc: External ID:

Description

Load package failed with DBXML error: Document not found. The detail message is: An Exeption occured in DB XML components. Error: Document not found: Library://xxx/xxx.xxx.

Attachments (1)

ticket#2346.patch (789 bytes) - added by zhanga 4 years ago.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by zhanga

Attachment: ticket#2346.patch added

comment:1 Changed 4 years ago by zhanga

The error actually happens in method below:

void MgResourceHeaderManager::DeleteDocument(MgResourceIdentifier& resource,
    XmlDocument& xmlDoc, XmlUpdateContext& updateContext)
{
    MG_RESOURCE_SERVICE_TRY()
    // Check if the current user is allowed to perform the current operation.
    CheckParentPermission(resource, MgResourcePermission::ReadWrite);
    // Delete the resource.
    MgResourceDefinitionManager::DeleteDocument(xmlDoc, updateContext);
    // Update the local permission cache.
    UpdatePermissionCache(MgResourceService::opIdDeleteResource,
        resource.ToString(), MgResourcePermission::ReadWrite, xmlDoc, false);

    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgResourceHeaderManager.DeleteDocument")
}

The resource is deleted in DeleteDocument? call. But in the following UpdatePermissionCache? call, it will try to get the document, which results in a 'Document not found' error. Now change the order of the 2 calls to fix the issue.

comment:2 Changed 4 years ago by jng

Resolution: fixed
Status: newclosed

Fixed trunk (r7832) and 2.5 (r7856)

Note: See TracTickets for help on using tickets.