class SimpleVersioningManager implements VersioningManager {

    @Override
    public Resource commit(Resource catalogId, Resource recordId, Resource branchId, User user, String message) {
        try (RepositoryConnection conn = getCatalogRepoConnection()) {
            OrmFactory<? extends VersionedRDFRecord> correctFactory = getFactory(recordId, conn);
            VersionedRDFRecord record = catalogUtils.getRecord(catalogId, recordId, correctFactory, conn);
            VersioningService<VersionedRDFRecord> service =
                    versioningServices.get(correctFactory.getTypeIRI().stringValue());
            conn.begin();
            Resource commitResource = commitToBranch(record, service, branchId, user, message, conn);
            conn.commit();
            return commitResource;
        }
    }

}