public synchronized void sessionRefreshed(dk.brics.jwig.Session s) {
if (s instanceof DBSession) {
DBContext dbContext = sessionContextMap.get(s);
if (dbContext == null) {
log.warn("dbContext is null for session " + s.getID() + " with timeout " + new Date(s.getTimeout()), new Exception());
throw new BadRequestException("Session timeout");
}
threadContextMap.remove(dbContext.getActiveThread());
Thread activeThread = Thread.currentThread();
dbContext.setActiveThread(activeThread);
threadContextMap.put(activeThread, dbContext);