Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 Quartz 作业详细信息 bean 中编写数据库逻辑。我可以在没有任何明确声明的情况下做到这一点,或者如何正确地做到这一点以确保它在事务中运行?
一个例子很好,但我建议您简单地添加@Transactional到您正在运行的方法中。那应该这样做。
@Transactional
更多信息在这里: http ://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/transaction/annotation/Transactional.html