Hi,
I am reading the UserInterceptor class. It seems that for each HTTP request, user database is accessed to get the UserImpl object. Why is this needed even though the userImpl could be already stored in the userContext which is stored in the session?
regards
yang
anonymous wrote :
| // Get the id
| String remoteUser = req.getRemoteUser();
|
| // Fetch user
| UserImpl user = null;
| try
| {
| if (remoteUser != null)
| {
| Session session = getSession();
| Query query = session.createQuery("from UserImpl as u where u.userName=?");
| query.setString(0, remoteUser);
| user = (UserImpl)query.uniqueResult();
| }
| }
| catch (Exception e)
| {
| log.error("Cannot fetch user from hibernate", e);
| }
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3886381#3886381
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3886381
|