Update Metadata.java

Rollback the transaction if an exception is raised during the merge or during the commit.