MetaGraphTx tx = metaGraphService.newTransaction();
try {
ProjectMetadata projectMetadata = tx.getProject(projectId);
if (projectMetadata == null) {
throw new NotFound(ProjectMetadata.class, projectId);
}
UserMetadata otherUserMetadata = tx.getUserByName(item.getName());
if (otherUserMetadata == null) {
throw new NotFound(UserMetadata.class);
}
projectMetadata.addUser(otherUserMetadata);
} catch (Throwable t) {
tx.rollback();