How do I fix this caching issue?

I have the following code in an Edit action, where the model contains the id of a parent entity. It all works, and the changes are reflected in the database, but when reparenting, sometimes the nhibernate cache doesn’t reflect them on screen. This is an issue I touched on a few days ago, in another thread, but I’d really like to see if I can overcome the it. Also, if the code can be cleaned up (the fault may actual be there), suggest something there also.

// do we have a destination parent id
if (model.ParentId.HasValue)
{
 
// yes, fetch the destination parent
var parent = forumRepository.SelectById(model.ParentId.Value);
 
// is it the same as the current parent
if (entity.Parent == parent)
 
// yes, just update the entity
forumRepository.Update(entity);
 
else
{
 
// no, reparent the entity, then save the parent
parent.AddChild(entity);
forumRepository.Update(parent);
 
}
 
// return to the parent detail view
return RedirectToAction("Detail", new { id = model.ParentId.Value });
 
}
else
{
 
// no, are we currently parented
if (entity.Parent != null)
{
 
// remove the entity from the parent, then update the parent
entity.Parent.RemoveChild(entity);
forumRepository.Update(entity.Parent);
 
}
 
// now update the parentless entity
forumRepository.Update(entity);
 
// return to the overall manager
return RedirectToAction("Manager");
 
}

Not sure what I did, but this is also now fixed. Sorry to bother you.