Hi,

I use a dispatcher to log page access, I need to use sessionManager to
commit otherwise the log will not be saved to the mysql, however, the commit
sometimes produce undesirable effects to the page, is there a way to
maintain a separate sessionManager in addition to the default
SessionManager? or any easier way to maintain a log in the mysql? thanks.

Angelo

public class LoggingDispatcher implements Dispatcher {

    private final HibernateSessionManager sessionManager;
  
        public LoggingDispatcher(HibernateSessionManager sessionManager) {
        this.sessionManager = sessionManager;
    }

    public boolean dispatch(Request request, Response response) throws
IOException {

        PageLog log = new PageLog();
        log.setPath(request.getPath());
        sessionManager.getSession().save(log);
        sessionManager.commit();
        return false;
    }
}
-- 
View this message in context: 
http://www.nabble.com/T5%3A-using-SessionManager-in-a-dispatcher-tp18610159p18610159.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to