// Otherwise clean up the session if there are any pending changes.
// Those changes are not persisted, but dropped. If this fails, the
// session is logged out and not returned/added to the pool
try {
if (session.hasPendingChanges()) {
session.refresh(false);
}
} catch (RepositoryException re) {
log.info("Cannot check or drop pending changes of session " +
"{}, logging out", userId);
this.poolDropCounter++;