Hi there,
I have a web application runing with hibernate. My DAOs are annotated as @Repository and everything works fine. However, I want to run scheduled jobs within my application logic by using the @Scheduled annotation. How can I configure everything so that the DAOs get a valid session injected when there is no HTTP-request but a scheduled event calls my logic? Currently I get an exception:Any ideas?PHP Code:04.03.2010 18:48:03 org.springframework.scheduling.support.MethodInvokingRunnable run
SCHWERWIEGEND: Invocation of method 'foo' on target class [class net.appazaar.server.jee.domain.RecommenderSystem] failed
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)
Best regards,
mboehmer


Reply With Quote