javaspringspring-transactionsquartz

Java Quartz Spring transaction support


I need to write a database logic in Quartz job detail bean. Can I do that without any explicit declarations, or how to do that properly to be sure it runs in transaction?


Solution

  • An example would be good but I suggest that you simply add @Transactional to the method you are running. That should do it.

    More info here: http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/annotation/Transactional.html