ah ... now I see. thanks for the explanation... 

just a nit, but could be rewritten to express this in a more obious way:
```
if (session != null) {
  try {
    // check if session is valid (isNew() will throw if not)
    session.isNew();
    return session;
  }
  catch (IllegalStateException e) {
    // session has been invalidated
  } 
}
```