Make sure that when layers are loaded from the db, they include the workspace.  Without this, the workspace was getting cleared when updating the layers after layer order change