public <T> void update(T bean) throws StorageException {
        EntityManager entityManager = getActiveEntityManager();
        try {
            if (!entityManager.contains(bean)) {
                entityManager.merge(bean);
            }
        } catch (Throwable t) {
            LOGGER.error(t.getMessage(), t);
            throw new StorageException(t);
        }
    }
@param bean the bean to update
@throws StorageException if a storage problem occurs while storing a bean
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java