What version are you using? It works fine on 2014, however the changes weren't visual until doing a regen. At first I thought this would be a simple fix by using the documents transaction manager instead of the database, but for some reason that still didn't work and was forced to add ed.Regen() after your transaction.
Hope that helps