Reserved schema names are not checked, cause unexpected behavior instead of errors

I was creating a custom schema that has to do with some new versioning properties, and I named it “versions”. This inadvertently collided with the existing “versions” table name, resulting in the following unexpected behavior.

My new properties inside that schema would save correctly on documents, but would get skipped any time I copied or checked in versioned the document. The live document still had the values, but they got lost on the new copy or archive version. This behavior was troublesome because there were no errors at all, just values that quietly fail to copy. After some digging, I found that this was caused by org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.copy() where it specifically skips any tables with the names “versions” or “hierarchy”.

The framework should have checks for any reserved schema names and give a clear error when a collision is encountered.

0 votes

0 answers

749 views

ANSWER