code: protected synchronized void assertNotStale() {
  
  		if (stale) {
  
  			// invalidate caches
  			onRemoveFromCache();
  
  			// if a node/rel was deleted in a previous transaction but the caller keeps a
  			// reference to this entity, we need to make sure that the reference is fresh.
  
  			final SessionTransaction tx   = db.getCurrentTransaction();
  			final Map<String, Object> map = new HashMap<>();
  
  			map.put("id", id);
  
  			data.clear();
  
  			try {
  
  				// update data
  				update(tx.getEntity(getQueryPrefix() + " WHERE ID(n) = $id RETURN n", map).asMap());
  
  			} catch (NoSuchRecordException nex) {
  				throw new NotFoundException(nex);
  			}
  
  			stale  = false;
  		}
  	}
docs: ----- protected methods -----