Frans,
I don't even know where to start on this one!
After calling the following line of code, rowsAffected is = 1... but nothing hits the database.
rowsAffected = Adapter.UpdateEntitiesDirectly(folderLinkEntity, filter);
I'm stepping through the code on one side and looking at SQL Profiler on the other side. No SQL is sent to the db.
Any ideas on where to start looking?
UPDATE: BTW I havent had an opportunity to upgrade to 2004.2 yet... So this is 2004.1
Marcus
Full method:
protected override IResponse DoExecute(IRequest request)
{
MoveFolderRequestType req = CastRequest(request);
FolderLinkEntity folderLinkEntity = new FolderLinkEntity();
folderLinkEntity.ChildFolderUID = req.FolderUID;
folderLinkEntity.ParentFolderUID = req.NewParentFolderUID;
IRelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add(PredicateFactory.CompareValue(FolderLinkFieldIndex.ParentFolderUID, ComparisonOperator.Equal, req.OldParentFolderUID));
filter.PredicateExpression.Add(PredicateFactory.CompareValue(FolderLinkFieldIndex.ChildFolderUID, ComparisonOperator.Equal, req.FolderUID));
int rowsAffected;
try
{
rowsAffected = Adapter.UpdateEntitiesDirectly(folderLinkEntity, filter);
}
catch(SqlException ex)
{
if (ex.Number == 2627) { // Violation of PRIMARY KEY constraint
throw new SdsAlreadyExistsException("The folder already exists at the destination.", ex);
} else
{
throw;
}
}
if (rowsAffected != 1)
{
Log.Warn(string.Format("Move FolderUID '{0}' failed. Attempted to move from '{1}' to '{2}' but rows affected was {3}", req.FolderUID, req.OldParentFolderUID, req.NewParentFolderUID, rowsAffected));
throw new SdsNotFoundException("Either the folder no longer exists, or it has already been moved by another user.");
}
return CreateResponseObject();
}