Dave wrote:
On 3/29/07, gregh <[EMAIL PROTECTED]> wrote:old version: public UserData getAuthenticatedUser() { return authenticatedUser; } 3.0> version: public UserData getAuthenticatedUser() { UserData authenticUser = null; if(userId != null) { try { UserManager mgr = RollerFactory.getRoller().getUserManager(); authenticUser = mgr.getUser(userId); } catch (RollerException ex) {log.warn("Error looking up authenticated user "+userId, ex);} } return authenticUser; }We probably made that change so that callers of getAuthenticatedUser() get a O/R "managed" entity instead of a stale one.
Correct, the old code returned a detached object which can cause problems when you are doing lazy fetching on objects.
-- Allen
- Dave
