We use a clustered TerracottaDirectory. The replaceIndex-Operation fails with an "Attempt to access a shared object outside the scope of a shared lock" since the setLastModified method is not synchronized. Refering to the comment in the source code " // Not syncronize on get/set lastModified, should be ok, but needs to be verified" this is the required verification

. Adding a "synchronized" to the method works.