Prevent from sticking an invalid dataset name in the doc

if one updates a doc before it is acquired, an un-physical dataset name is registered in the document, creating un-ncessary queries to dbs, and making the history having different datasets in it.
See 7a02d3ffeeb633b64cb9faf751e41049ec6d1b3f.