Fixed in 1.7-SNAPSHOT build 201406021653 There was two parts to this issue: The first was a bug in envers that was causing the audit events to be retained when a rollback occurred which means using the same entity manager twice would mean that the events would be persisted when they shouldn't have been. This was the cause for the NonUniqueException. The second was the way that info nodes were being updated. The deleted node wasn't getting removed which meant that it was trying to set the removed/changed info nodes ContentSpecNodeID to null. This was the cause of the foreign key exception. Note: This version has been deployed to the test/development server.
For the envers bug it was fixed in hibernate 4.2.1.Final. Since this isn't available in AS7 or until EAP 6.2 we've implemented a workaround which is to make sure that we don't reuse the same entity manager twice.
Reran the curl commands and the resulting spec was editable in the UI.