使用Spring @Transcation时如何在每个线程中回滚事务?
Spring Transcation不支持多线程,这意味着每个线程将拥有自己的连接/事务。
我想在下面的示例中知道如何回退Threads的run()方法(如果其中抛出异常)。 (就像require_new一样)
我的预期结果只是“开始”和“结束”。
主类:
@SpringBootApplication
public class Application implements CommandLineRunner {
@Autowired
private TestService testServ...