Java- TimerTask-org.hibernate.HibernateException: No Session found for current thread

My coding is having bug at getTokenDAO().updateDate(newtok, new Date()); line where it pops out org.hibernate.HibernateException: No Session found for current thread. Please help me to fix this problem. Here is my coding

Timer t = new Timer();
t.scheduleAtFixedRate(
    new TimerTask() {
        public void run() {
            try {
                getTokenDAO().updateDate(newtok, new Date());
            } catch (Exception e) {
                e.printStackTrace();
            }
            System.out.println("5 minutes passed");
        }
    },
    0,      // run first occurrence immediately
    300000);  
}

PS: I am using Spring

The scheduler will run your TimerTask in a new thread. The session/transaction is saved in a ThreadLocal variable.

You will have to open a new transaction inside the run() method in your TimerTask.