Reported by Janna Wemekamp, see http://permalink.gmane.org/gmane.comp.cms.fedora-commons.user/6275
Updating a DC datastream stored as Managed Content fails if the datastream is not versionable.
This is due to a RI update error.
The triple update compares the "before" and "after" states of an object. Currently it does this after managed content datastream changes have been persisted - so the "before" state is unavailable, and it therefore fails.
We could move the update to happen before the managed datastreams are saved, however if there is an error/exception later in the code, this means that the RI will be out of sync with the object contents.
(note that for a purge, this does in fact happen in this sequence - so we potentially already have the problem that if a purge fails then the RI is out of sync).
Moving the update to happen before the managed datastreams are updated is probably ok as a short-term solution, but ideally we need some kind of transactional behaviour - maybe we modify the RI update code so that it can (a) get a list of updates (adds and deletes) and then (b) later persist those updates.