Understanding Spring Transaction boundaries

后端 未结 2 1114
栀梦
栀梦 2020-12-17 06:24

I am trying to clear my doubts w.r.t. Spring Transaction boundaries with following example.

@Transactional(propagation=Propagation.REQUIRES_NEW)
public void          


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 06:57

    test() should probably be SUPPORTS, so if there is an existing TX, it will be propagated to test1(). test1() should be REQUIRED so your insert actually commits. test2() should be REQUIRES_NEW.

提交回复
热议问题