JCRMessage membership = (JCRMessage) member;
if (membership.isPersistent()) {
try {
Node messageNode = getSession().getNodeByIdentifier(membership.getId());
membership.merge(messageNode);
} catch (RepositoryException e) {
throw new MailboxException("Unable to update flags for message " + membership + " in mailbox " + mailbox, e);
} catch (IOException e) {
throw new MailboxException("Unable to update flags for message " + membership + " in mailbox " + mailbox, e);