-
Notifications
You must be signed in to change notification settings - Fork 1
/
spring-transaction.drawio
1655 lines (1655 loc) · 249 KB
/
spring-transaction.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<mxfile host="Electron" modified="2024-11-21T08:54:41.098Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.5 Chrome/114.0.5735.243 Electron/25.3.1 Safari/537.36" etag="BVznWva1V-HHzFagjWyX" version="21.6.5" type="device" pages="2">
<diagram id="j0OrxLXEKiOk3vR1xS3o" name="编程式事务">
<mxGraphModel dx="2603" dy="842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="3k61qGwMEzmhM3xupUGX-4" value="连接来源" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;curved=1;strokeColor=#97D077;" parent="1" source="3k61qGwMEzmhM3xupUGX-2" target="t2Bh8Tgv82BLZMkkJCVr-75" edge="1">
<mxGeometry x="-0.9806" relative="1" as="geometry">
<Array as="points">
<mxPoint x="1320" y="1322" />
<mxPoint x="2083" y="1322" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-25" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-9" target="t2Bh8Tgv82BLZMkkJCVr-39" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1320" y="1360" />
<mxPoint x="1320" y="1651" />
<mxPoint x="1130" y="1651" />
<mxPoint x="1130" y="1931" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-47" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-42" target="3tcmVddGPVW7wgybLThJ-46" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-48" value="<b>else<br>即SUPPORTS/NOT_SUPPORTED/NEVER<br></b>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=9;fontColor=#007FFF;" parent="3tcmVddGPVW7wgybLThJ-47" connectable="0" vertex="1">
<mxGeometry x="-0.6824" y="-23" relative="1" as="geometry">
<mxPoint x="13" y="23" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="KUTTFBSQQBKSvKt4xpuZ-1" value="<h1 style="font-size: 18px"><font style="font-size: 18px">Spring 编程式事务 工作原理(5.0.7)</font></h1><div>这里讲Spring编程式事务的原理。声明式事务参考第2个Tab页(其实就是编程式事务+AOP)。</div><p><font style="font-size: 14px">前置知识:</font></p><ul><li>MySQL事务(事务是数据库提供的能力,从JDBC事务到Spring事务是对底层事务接口的层层封装)</li><li>Spring JDBCTemplate(JDBC事务操作、保存点)</li><li>Spring AOP (Spring对声明式事务的封装使用了AOP)</li><li>Spring组件(ReflectionUtils、...)</li></ul><p></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="40" y="19" width="600" height="161" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-1" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;curved=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-2" target="6U_a8jkAf0Mo0z_RWQwz-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-2" value="start" style="ellipse;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="100" y="200" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-5" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;curved=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-3" target="6U_a8jkAf0Mo0z_RWQwz-4" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-16" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-3" target="3tcmVddGPVW7wgybLThJ-1" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint y="310" />
<mxPoint y="280" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-3" value="DataSource ds = new <b>DriverManagerDataSource</b>(<br>url, user, password)<br><font color="#007fff">创建数据源</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="40" y="280" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-7" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-4" target="6U_a8jkAf0Mo0z_RWQwz-6" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontColor=#330000;dashed=1;curved=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-4" target="3tcmVddGPVW7wgybLThJ-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-11" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontColor=#007FFF;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-4" target="3tcmVddGPVW7wgybLThJ-9" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-17" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-4" target="3tcmVddGPVW7wgybLThJ-7" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-4" value="TransactionTemplate template = new <b>TransactionTemplate</b>()<br><font color="#007fff">创建与数据库事务连接模板</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="40" y="400" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-9" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-6" target="6U_a8jkAf0Mo0z_RWQwz-8" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-13" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontColor=#007FFF;dashed=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-6" target="3tcmVddGPVW7wgybLThJ-12" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-18" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-6" target="3tcmVddGPVW7wgybLThJ-19" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="310" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-6" value="PlatformTransactionManager txManager =<br>new <b>DataSourceTransactionManager</b>(ds)&nbsp;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="40" y="520" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-11" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-8" target="6U_a8jkAf0Mo0z_RWQwz-10" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-8" value="template.setTransactionManager(<br>txManager)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="40" y="640" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-13" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-10" target="6U_a8jkAf0Mo0z_RWQwz-12" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-10" target="t2Bh8Tgv82BLZMkkJCVr-3" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="320" y="840" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-10" value="template.<b>execute</b>(...)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="40" y="760" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-147" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="6U_a8jkAf0Mo0z_RWQwz-12" target="t2Bh8Tgv82BLZMkkJCVr-146" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="760" y="780" />
<mxPoint x="760" y="385" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="6U_a8jkAf0Mo0z_RWQwz-12" value="TransactionCallback#<b>doInTransaction</b>(<br>TransactionStatus status)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="320" y="760" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-1" value="org.springframework.jdbc.datasource.DriverManagerDataSource" style="swimlane;startSize=20;" parent="1" vertex="1">
<mxGeometry x="-520" y="280" width="480" height="160" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-2" value="<div><font color="#330000"><b>url</b> = "jdbc:mysql://localhost:3306/spring-tx?useSSL=false"</font></div><div><font color="#330000"><b>username</b> = "root"</font></div><div><font color="#330000"><b>password</b> = "123456"</font></div><div><font color="#330000">catalog = null</font></div><div><font color="#330000"><b>schema</b> = null</font></div><div><font color="#330000"><b>connectionProperties</b> = null</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="3tcmVddGPVW7wgybLThJ-1" vertex="1">
<mxGeometry y="20" width="480" height="140" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontColor=#330000;curved=1;" parent="1" source="3tcmVddGPVW7wgybLThJ-3" target="3tcmVddGPVW7wgybLThJ-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-3" value="&lt;cinit&gt;<br>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="320" y="380" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-5" value="Constants constants = new Constants(<b>TransactionDefinition</b>.class)<br><font color="#007fff">读取TransactionDefinition public static final 字段存到&nbsp;<b>fieldCache</b> Map中,</font><font color="#cc0066">什么用?</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="480" y="375" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-7" value="org.springframework.transaction.support.TransactionTemplate" style="swimlane;startSize=20;" parent="1" vertex="1">
<mxGeometry x="-520" y="480" width="480" height="160" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-8" value="<div><b style="color: rgb(51 , 0 , 0)">transactionManager</b><span style="color: rgb(51 , 0 , 0)"> = null</span><br></div><div><b style="color: rgb(51 , 0 , 0)">propagationBehavior</b><font color="#330000"> = 0</font><span style="color: rgb(51 , 0 , 0)">	</span><span style="color: rgb(51 , 0 , 0)">	</span><font color="#007fff">//0是<b>PROPAGATION_REQUIRED</b>, 即默认的事务传递策略</font></div><div><b style="color: rgb(51 , 0 , 0)">isolationLevel</b><font color="#330000"> = -1</font><span style="color: rgb(51 , 0 , 0)">	</span>			<font color="#007fff">//-1是<b>ISOLATION_DEFAULT</b>, 即默认使用数据库默认的隔离级别</font></div><div><font color="#330000">timeout = -1</font><span style="color: rgb(51 , 0 , 0) ; white-space: pre">	</span><font color="#007fff">//TIMEOUT_DEFAULT</font></div><div><font color="#330000">readOnly = false</font></div><div><font color="#330000">name = null</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="3tcmVddGPVW7wgybLThJ-7" vertex="1">
<mxGeometry y="20" width="480" height="140" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-9" value="&lt;init&gt;<br><font color="#007fff">主要是设置默认的事务传播策略、隔离级别等</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="320" y="440" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-15" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-12" target="3tcmVddGPVW7wgybLThJ-14" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-12" value="&lt;cinit&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="320" y="500" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-14" value="<font style="font-size: 9px">Constants constants = new Constants(<br><b>AbstractPlatformTransactionManager</b>.class);<font color="#007fff"><br>同上</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="480" y="500" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-25" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-19" target="3tcmVddGPVW7wgybLThJ-24" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-19" value="&lt;init&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="320" y="560" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-23" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-20" target="3tcmVddGPVW7wgybLThJ-22" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-20" value="setDataSource(dataSource)<br><font color="#007fff">如果dataSource是代理对象,先获取原始类型对象</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="480" y="620" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-22" value="afterPropertiesSet()<br><font color="#007fff">只是字段为空检查</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="480" y="680" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-26" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-24" target="3tcmVddGPVW7wgybLThJ-20" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-24" value="this()<br><font color="#007fff">一些字段初始化</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="480" y="560" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-27" value="org.springframework.jdbc.datasource.DataSourceTransactionManager" style="swimlane;startSize=20;" parent="1" vertex="1">
<mxGeometry x="-520" y="680" width="480" height="160" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-28" value="<div><font color="#330000"><b>dataSource</b> = {DriverManagerDataSource@738}&nbsp;</font></div><div><font color="#330000">enforceReadOnly = false</font></div><div><span style="color: rgb(51 , 0 , 0)">transactionSynchronization = 0</span><br></div><div><font color="#330000">defaultTimeout = -1</font></div><div><font color="#330000">nestedTransactionAllowed = true</font></div><div><font color="#330000">validateExistingTransaction = false</font></div><div><font color="#330000"><b>globalRollbackOnParticipationFailure</b> = true</font></div><div><font color="#330000">failEarlyOnGlobalRollbackOnly = false</font></div><div><font color="#330000">rollbackOnCommitFailure = false</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="3tcmVddGPVW7wgybLThJ-27" vertex="1">
<mxGeometry y="20" width="480" height="140" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-8" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-3" target="t2Bh8Tgv82BLZMkkJCVr-7" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-10" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-3" target="t2Bh8Tgv82BLZMkkJCVr-9" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-3" value="<font style="font-size: 8px">this.transactionManager instanceof CallbackPreferringPlatformTransactionManager</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="340" y="840" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-7" value="<font color="#007fff">DEMO没走这里,TODO</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="560" y="860" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-12" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-9" target="t2Bh8Tgv82BLZMkkJCVr-11" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-25" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-9" target="t2Bh8Tgv82BLZMkkJCVr-24" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-9" value="TransactionStatus <b>status</b> = this.transactionManager.getTransaction(this)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="310" y="960" width="220" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-14" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-11" target="t2Bh8Tgv82BLZMkkJCVr-13" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-19" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=1;entryDx=0;entryDy=0;fontSize=8;dashed=1;strokeColor=#00CC66;shape=link;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-11" target="6U_a8jkAf0Mo0z_RWQwz-12" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="540" y="3280" />
<mxPoint x="540" y="800" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-11" value="result = action.doInTransaction(status)<br><font color="#007fff">在事务中执行业务操作</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="322.5" y="3260" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-16" value="Y, 异常" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-13" target="t2Bh8Tgv82BLZMkkJCVr-15" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-18" value="N,无异常" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-13" target="t2Bh8Tgv82BLZMkkJCVr-17" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-13" value="RuntimeException <br>| Error | Throwable ex" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="362.5" y="3360" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-23" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-15" target="t2Bh8Tgv82BLZMkkJCVr-22" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-158" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-15" target="t2Bh8Tgv82BLZMkkJCVr-157" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-15" value="rollbackOnException(status, ex)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="562.5" y="3380" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-21" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-17" target="t2Bh8Tgv82BLZMkkJCVr-20" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-113" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-17" target="xfdcjk_qxBO9EsxSu5Ji-112" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-116" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-17" target="xfdcjk_qxBO9EsxSu5Ji-114" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-17" value="this.transactionManager.commit(status)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="322.5" y="3520.5" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-20" value="return result;" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="322.5" y="3662" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-22" value="throw ex<br><font color="#007fff">如果有外层事务,会被外层事务再次捕获</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="562.5" y="3440" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-27" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-24" target="t2Bh8Tgv82BLZMkkJCVr-26" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-39" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-24" target="3tcmVddGPVW7wgybLThJ-31" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-24" value="Object transaction = doGetTransaction();<br><font color="#007fff">从缓存获取事务对象(事务对象本质是带着事务控制参数的连接对象)</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="560" y="960" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-29" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-26" target="t2Bh8Tgv82BLZMkkJCVr-28" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-26" value="DataSourceTransactionObject txObject = new <b>DataSourceTransactionObject</b>()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="960" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-31" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-28" target="t2Bh8Tgv82BLZMkkJCVr-30" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-28" value="txObject.setSavepointAllowed(<br>isNestedTransactionAllowed())<br><font color="#007fff">savepointAllowed = true;<br></font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="1020" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-33" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-30" target="t2Bh8Tgv82BLZMkkJCVr-32" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-30" value="<div style="font-size: 9px"><div>ConnectionHolder conHolder = (ConnectionHolder) <b>TransactionSynchronizationManager</b><br>.<b>getResource</b>(obtainDataSource());</div><div>txObject.setConnectionHolder(conHolder, false);<br><font color="#007fff" style="font-size: 9px">从resources ThreadLocal中获取连接,</font></div><div><font color="#007fff" style="font-size: 9px">首次执行connectionHolder获取肯定为空,如果外层有事务就是返回外层事务的连接</font><br></div></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="785" y="1075" width="230" height="80" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-137" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#97D077;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-32" target="t2Bh8Tgv82BLZMkkJCVr-69" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1380" y="1148" />
<mxPoint x="1380" y="1970" />
<mxPoint x="1590" y="1970" />
<mxPoint x="1590" y="2290" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-32" value="Object value = doGetResource(actualKey)<br><font color="#007fff">从缓存<b>NamedThreadLocal</b>找线程此数据源对应的连接的副本,首次获取为null,后面会创建并缓存到这个缓存空间,再内层事务再次获取就返回这个缓存的连接</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1060" y="1082.5" width="190" height="65" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-37" value="TransactionSynchronizationManager<br>.isSynchronizationActive()<br>即&nbsp;synchronizations TheadLocal是否非空" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-34" target="t2Bh8Tgv82BLZMkkJCVr-36" edge="1">
<mxGeometry x="-0.145" y="10" relative="1" as="geometry">
<Array as="points">
<mxPoint x="1122.5" y="1920" />
<mxPoint x="1122.5" y="1740" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-40" value="transaction != null" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-34" target="t2Bh8Tgv82BLZMkkJCVr-39" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-41" value="else" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-34" target="t2Bh8Tgv82BLZMkkJCVr-42" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1142.5" y="2020" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-41" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-34" target="t2Bh8Tgv82BLZMkkJCVr-43" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-34" value="SuspendedResourcesHolder suspendedResources = <b>suspend</b>(null);<br><font color="#007fff" style="font-size: 8px">挂起事务;传递null, 就只是判断下事务同步器Set是否不为空,不为空要递归调用所有同步器的suspend方法然后将其他ThreadLocal资源重置</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="882.5" y="1890" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-117" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=none;strokeColor=#000000;noLabel=1;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-36" target="t2Bh8Tgv82BLZMkkJCVr-116" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-119" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=none;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-36" target="t2Bh8Tgv82BLZMkkJCVr-118" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-36" value="suspendedSynchronizations = doSuspendSynchronization()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1162.5" y="1720" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-39" value="<font color="#007fff">TODO</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1162.5" y="1921" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-42" value="return null;" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1162.5" y="2000" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-46" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-43" target="t2Bh8Tgv82BLZMkkJCVr-45" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-43" value="boolean newSynchronization = (getTransactionSynchronization() != SYNCHRONIZATION_NEVER)<br><font color="#007fff">true</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="882.5" y="2060" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-48" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-45" target="t2Bh8Tgv82BLZMkkJCVr-47" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-50" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-45" target="t2Bh8Tgv82BLZMkkJCVr-49" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-45" value="<div>DefaultTransactionStatus status = <b>newTransactionStatus</b>(<span>definition, transaction, true, newSynchronization, debugEnabled, suspendedResources);<br><font color="#007fff">1 新建用于保存事务状态的对象</font></span></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="882.5" y="2135" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-47" value="<div>new <b>DefaultTransactionStatus</b>(<span>transaction, newTransaction,actualNewSynchronization,</span></div><div><span>definition.isReadOnly(), debug,suspendedResources)</span></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2140" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-52" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-49" target="t2Bh8Tgv82BLZMkkJCVr-51" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-65" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-49" target="t2Bh8Tgv82BLZMkkJCVr-64" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-49" value="<b>doBegin</b>(transaction, definition)<br><font color="#007fff" style="font-size: 8px">2 创建连接及连接初始化(是否设置只读、设置隔离级别、事务结束后是否恢复自动提交、事务超时时间等、最后绑定资源)</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="882.5" y="2225" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-55" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-51" target="t2Bh8Tgv82BLZMkkJCVr-54" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-51" value="prepareSynchronization(status, definition)<br><font color="#007fff" style="font-size: 8px">设置其他NamedThreadLocal的值</font><div style="font-size: 8px"><font color="#007fff" style="font-size: 8px">如:事务名称、只读标志、隔离级别、事务活跃状态</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="882.5" y="3060" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-57" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-54" target="t2Bh8Tgv82BLZMkkJCVr-56" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-54" value="return status<br><font color="#007fff">DefaultTransactionStatus类型</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="882.5" y="3120" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-59" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-56" target="t2Bh8Tgv82BLZMkkJCVr-58" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-56" value="RuntimeException <br>| Error ex<br>上面流程有异常?" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="922.5" y="3180" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-58" value="resume(null, suspendedResources)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="3200" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-70" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-62" target="t2Bh8Tgv82BLZMkkJCVr-69" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-72" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-62" target="t2Bh8Tgv82BLZMkkJCVr-71" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-62" value="Connection newCon = obtainDataSource().getConnection()<br><font color="#007fff">刚启动没有建立连接,这里需要先建立连接</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="1362.5" y="2230" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-66" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-64" target="t2Bh8Tgv82BLZMkkJCVr-62" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-68" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-64" target="t2Bh8Tgv82BLZMkkJCVr-77" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1222.5" y="2294" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-64" value="<div style="font-size: 9px"><font style="font-size: 9px">!txObject.hasConnectionHolder() ||</font></div><div style="font-size: 9px"><font style="font-size: 9px">					txObject.getConnectionHolder()<br>.isSynchronizedWithTransaction()</font></div>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2220" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-100" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-69" target="t2Bh8Tgv82BLZMkkJCVr-77" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1462.5" y="2340" />
<mxPoint x="1222.5" y="2340" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-69" value="txObject.setConnectionHolder(new ConnectionHolder(newCon), true)<br><font color="#007fff">将新建的连接缓存到connectionHolder</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1362.5" y="2290" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-74" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-71" target="t2Bh8Tgv82BLZMkkJCVr-73" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-71" value="getConnectionFromDriver(getUsername(), getPassword())" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1602.5" y="2230" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-76" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-73" target="t2Bh8Tgv82BLZMkkJCVr-75" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-73" value="getConnectionFromDriverManager(url, props)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1842.5" y="2230" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-75" value="DriverManager.getConnection(url, props);<br><font color="#007fff">JDBC的接口(绿色节点)</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="2082.5" y="2230" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-80" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-77" target="t2Bh8Tgv82BLZMkkJCVr-79" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-77" value="txObject.getConnectionHolder()<br>.<b>setSynchronizedWithTransaction</b>(true)<br><font color="#007fff" style="font-size: 8px">只是创建个连接就算同步了?synchronizedWithTransaction字段是代表这意思吗?</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2360" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-82" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-79" target="t2Bh8Tgv82BLZMkkJCVr-81" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-79" value="con = txObject.getConnectionHolder()<br>.getConnection()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2430" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-85" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-81" target="t2Bh8Tgv82BLZMkkJCVr-84" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-139" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-81" target="t2Bh8Tgv82BLZMkkJCVr-138" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-81" value="Integer previousIsolationLevel = DataSourceUtils<br>.<b>prepareConnectionForTransaction</b>(con, definition)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2490" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-87" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-84" target="t2Bh8Tgv82BLZMkkJCVr-86" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-84" value="txObject.setPreviousIsolationLevel(<br>previousIsolationLevel)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2600" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-89" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-86" target="t2Bh8Tgv82BLZMkkJCVr-88" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-86" value="if (con.getAutoCommit()) :&nbsp;<br>txObject.setMustRestoreAutoCommit(true)<br>con.<b>setAutoCommit</b>(false);<br><font color="#007fff" style="font-size: 8px">如果当前是自动提交,记录一下事务执行完后要恢复设置为自动提交,然后关闭自动提交</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2660" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-93" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-88" target="t2Bh8Tgv82BLZMkkJCVr-92" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-95" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-88" target="t2Bh8Tgv82BLZMkkJCVr-94" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-88" value="prepareTransactionalConnection(con, definition)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2740" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-90" value="org.springframework.jdbc.datasource.DataSourceTransactionManager$DataSourceTransactionObject" style="swimlane;startSize=20;fontSize=9;" parent="1" vertex="1">
<mxGeometry x="-1040" y="680" width="480" height="120" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-91" value="<div><font color="#330000"><b>newConnectionHolder</b> = true</font></div><div><font color="#330000"><b>mustRestoreAutoCommit</b> = true</font></div><div><font color="#330000"><b>connectionHolder</b> = {ConnectionHolder@1479}&nbsp;</font></div><div><font color="#330000"><b>previousIsolationLevel</b> = null</font></div><div><font color="#330000"><b>savepointAllowed</b> = true</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="t2Bh8Tgv82BLZMkkJCVr-90" vertex="1">
<mxGeometry y="20" width="480" height="100" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-97" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-92" target="t2Bh8Tgv82BLZMkkJCVr-96" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-92" value="txObject.getConnectionHolder()<br>.setTransactionActive(true)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="2797.5" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-94" value="如果设置了事务只读<br>stmt.executeUpdate("SET TRANSACTION READ ONLY")" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1362.5" y="2740" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-99" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-96" target="t2Bh8Tgv82BLZMkkJCVr-98" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-96" value="<div style="font-size: 9px"><font style="font-size: 9px">if (timeout != TransactionDefinition.TIMEOUT_DEFAULT)&nbsp; :&nbsp;</font></div><div style="font-size: 9px"><font style="font-size: 9px">txObject.getConnectionHolder()<br>.setTimeoutInSeconds(timeout);</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1102.5" y="2860" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-103" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-98" target="t2Bh8Tgv82BLZMkkJCVr-102" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-141" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-98" target="t2Bh8Tgv82BLZMkkJCVr-140" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-98" value="<div style="font-size: 9px"><div>if (txObject.isNewConnectionHolder()) :&nbsp;</div><div>TransactionSynchronizationManager.<b>bindResource</b>(<br>obtainDataSource(), txObject.getConnectionHolder());</div></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#fad9d5;strokeColor=#ae4132;" parent="1" vertex="1">
<mxGeometry x="1102.5" y="2920" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-102" value="出现异常的话释放连接" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1122.5" y="3020" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-30" value="NamedThreadLocal(<br>"Transactional resources")" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=9;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1250" y="1095" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-37" value="Y<br><font style="font-size: 7px">说明存在外部事务,<br>使用外部事务处理<br>此内部事务<br></font>" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-31" target="3tcmVddGPVW7wgybLThJ-36" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-40" value="N, 当前没有连接对象,<br>事务对象是个空壳" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-31" target="3tcmVddGPVW7wgybLThJ-42" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-31" value="isExistingTransaction(<br style="font-size: 9px">transaction)<br style="font-size: 9px"><font color="#007fff" style="font-size: 8px">是否存在连接对象<br>且事务是活跃状态<br>首次走到这没有连接对象<br></font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="600" y="1160" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=7;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-36" target="xfdcjk_qxBO9EsxSu5Ji-3" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1020" y="1200" />
<mxPoint x="1020" y="1240" />
<mxPoint x="780" y="1240" />
<mxPoint x="780" y="1440" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-36" value="<b>return</b> <b>handleExistingTransaction</b>(definition, transaction, debugEnabled)<br><font color="#007fff">外部已有事务,处理内层事务都是走这里</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#f0a30a;fontColor=#000000;strokeColor=#BD7000;" parent="1" vertex="1">
<mxGeometry x="800" y="1175" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-44" value="<b>PROPAGATION_MANDATORY</b>" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-42" target="3tcmVddGPVW7wgybLThJ-43" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-45" value="<b>PROPAGATION_REQUIRED<br>||&nbsp;PROPAGATION_REQUIRES_NEW<br>||&nbsp;PROPAGATION_NESTED</b>" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-42" target="t2Bh8Tgv82BLZMkkJCVr-34" edge="1">
<mxGeometry y="40" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-42" value="definition<br>事务传播类型?<br><font color="#007fff">处理最外部事务走这里</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#f0a30a;fontColor=#000000;strokeColor=#BD7000;" parent="1" vertex="1">
<mxGeometry x="602.5" y="1760" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-43" value="<font style="font-size: 10px">throw&nbsp;&nbsp;IllegalTransactionStateException<br><font color="#007fff" style="font-size: 10px">前面走N,当前没有没有外部事务,没法融合到外部事务,肯定是抛异常</font></font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="882.5" y="1760" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-46" value="<font color="#007fff">TODO</font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="882.5" y="3300" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-105" value="org.springframework.transaction.support.TransactionSynchronizationManager" style="swimlane;startSize=20;" parent="1" vertex="1">
<mxGeometry x="-520" y="880" width="480" height="180" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-106" value="<div><font color="#007fff">这个类可以当作一个工具类,内部都是static方法,包含一组NamedThreadLocal静态成员, 关于这个类的作用,可以参考附录,主要就是通过ThreadLocal为数据库连接等状态化的对象提供一种线程安全的访问方式,这样虽然Spring中Service-&gt;DAO层都是单例对象,也可以在线上多线程环境下安全的访问底层有状态的资源。</font></div><div><b style="color: rgb(51 , 0 , 0)">resources</b><font color="#330000"> = {NamedThreadLocal@944} "Transactional resources"</font><span style="color: rgb(51 , 0 , 0) ; white-space: pre">	</span><font color="#007fff">//Connection、Session 等资源,<br>数据源对象-&gt;连接对象的Map</font></div><div><font color="#330000"><b>synchronizations</b> = {NamedThreadLocal@945} "Transaction synchronizations" </font><font color="#007fff">//事务同步器Set</font></div><div><b style="color: rgb(51 , 0 , 0)">currentTransactionName</b><font color="#330000"> = {NamedThreadLocal@946} "Current transaction name"</font><span style="color: rgb(51 , 0 , 0) ; white-space: pre">	</span><font color="#007fff">//事务对象名称</font></div><div><font color="#330000"><b>currentTransactionReadOnly</b> = {NamedThreadLocal@947} "Current transaction read-only status" </font><font color="#007fff">//事务只读状态</font></div><div><font color="#330000"><b>currentTransactionIsolationLevel</b> = {NamedThreadLocal@948} "Current transaction isolation level" </font><font color="#007fff">//事务隔离级别</font></div><div><font color="#330000"><b>actualTransactionActive</b> = {NamedThreadLocal@949} "Actual transaction active" </font><font color="#007fff">//事务活跃状态</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="t2Bh8Tgv82BLZMkkJCVr-105" vertex="1">
<mxGeometry y="20" width="480" height="160" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-107" value="<h1 style="font-size: 18px"><span style="font-size: 14px ; font-weight: normal">可借鉴学习:</span></h1><ul><li style="font-size: 11px">事务同步机制[TransactionSynchronizationManager] <br>本质:Spring通过ThreadLocal为状态化的对象提供一种线程安全的访问方法(使用线程私有的副本)。同时也方便工具类获取连接、注册事务同步器等操作,比如DataSourceUtils.getConnection() 、TransactionSynchronizationManager.registerSynchronization()。</li><font style="font-size: 10px">参考</font><span style="font-size: 11px">:</span><font color="#007fff" style="font-size: 11px">https://www.lyytaw.com/spring/spring_tx_TransactionSynchronizationManager<br>https://cloud.tencent.com/developer/article/1497685</font><br><font style="font-size: 11px"><span style="font-size: 10px">原理举例<font color="#007fff">:比如ThreadA、ThreadB连接数据库时都会维护一套自己的配置和状态(比如TransactionSynchronizationManager可以存储Connection、事务名称、只读状态、隔离级别、事务活跃状态等)存放在ThreadLocal,当某线程获取到执行权限,会加载自己的配置然后执行操作,执行完会或被抢占(比如事务被挂起)会将最新的配置和状态更新到ThreadLocal备用,然后将执行权限交给其他线程,其他线程加载自己的配置和状态,执行操作。</font><font color="#cc0066">看多线程下的事务代码验证一下</font></span></font><li style="font-size: 11px">TransactionSynchronization 拓展点的使用<br><font style="font-size: 10px" color="#007fff">比如:<br>1)处理事务中异步操作的坑,参考测试Demo:</font><font color="#007fff">SpringTransactionAsyncExample</font></li></ul><p></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1">
<mxGeometry x="640" y="19" width="760" height="221" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-109" value="本测试:TransactionTemplate 包含&nbsp;DataSourceTransactionManager,&nbsp;<br>DataSourceTransactionManager包含DriverManagerDataSource ,&nbsp;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="50" y="690" width="350" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-110" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.003;exitY=0.312;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#00CC66;exitPerimeter=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-8" target="3tcmVddGPVW7wgybLThJ-27" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-540" y="544" />
<mxPoint x="-540" y="680" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-111" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.001;exitY=0.172;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#00CC66;exitPerimeter=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-28" target="3tcmVddGPVW7wgybLThJ-1" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-550" y="724" />
<mxPoint x="-550" y="280" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-112" value="actualKey是前面配置的数据源" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=10;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1100" y="1060" width="150" height="20" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-113" value="<font style="font-size: 10px"><b><font style="font-size: 10px">事务传播类型:</font><br></b><font style="font-size: 10px"><b>MANDATORY</b>:外部存在事务就将当前操作融合到外部事务,外部不存在事务就抛异常;</font><br><font style="font-size: 10px"><b>REQUIRED</b>(默认):外部存在事务就将当前操作融合到外部事务,外部不存在事务就新建事务;</font><br><font style="font-size: 10px"><b>REQUIRES_NEW</b>:外部存在事务就将外部事务先挂起,然后创建新事务,外部不存在事务直接创建新事务;<br></font><b>NESTED</b>:外部存在事务就将当前操作融合到外部事务,SavePoint外层影响内层内层不影响外层,外部不存在事务直接创建新事务;<br><b>SUPPORTS</b>: 外部存在事务就将当前操作融合到外部事务,外部不存在事务也不创建新事务;<br><b>NOT_SUPPORTED</b>:&nbsp;外部存在事务就将外部事务挂起,外部不存在事务也不创建新事务;<br><b>NEVER</b>:&nbsp;外部存在事务就抛异常,外部不存在事务也不创建新事务;<br></font>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=8;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="297.5" y="1840" width="425" height="150" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-115" value="TransactionSynchronization 事务同步器接口:<br>参考Markdown文档" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-790" y="880" width="260" height="90" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-121" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=none;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-116" target="t2Bh8Tgv82BLZMkkJCVr-120" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-130" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-116" target="t2Bh8Tgv82BLZMkkJCVr-129" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-116" value="<div>if (transaction != null) {</div><div>suspendedResources = <b>doSuspend</b>(transaction);</div><div>}<br><font color="#007fff">这个是事务挂起操作</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;align=left;" parent="1" vertex="1">
<mxGeometry x="1142.5" y="1780" width="240" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-118" value="1 遍历所有事务同步器执行suspend()方法" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1422.5" y="1720" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-123" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=none;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-120" target="t2Bh8Tgv82BLZMkkJCVr-122" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-124" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=none;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-120" target="t2Bh8Tgv82BLZMkkJCVr-122" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-120" value="txObject.setConnectionHolder(null)<br><font color="#007fff">2 清除事务对象的连接对象</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;align=center;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1422.5" y="1785" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-126" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-122" target="t2Bh8Tgv82BLZMkkJCVr-125" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-164" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#82b366;dashed=1;fillColor=#d5e8d4;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-122" target="t2Bh8Tgv82BLZMkkJCVr-98" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1662.5" y="1880" />
<mxPoint x="1662.5" y="2920" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-122" value="TransactionSynchronizationManager<br>.<b>unbindResource</b>(obtainDataSource())" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;align=center;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1422.5" y="1840" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-125" value="3.1 就是将resources ThreadLocal中此数据源的连接对象清除掉" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;align=center;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1662.5" y="1840" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-127" value="AbstractPlatformTransactionManager" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=10;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="892.5" y="1870" width="180" height="20" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-129" value="3.2 重置其他NamedThreadLocal的值<br>如:事务名称、只读标志、隔离级别、事务活跃状态<font color="#007fff">(设置为不活跃)</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="1162.5" y="1860" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-132" value="<font style="font-size: 10px">即null事务挂起:<br>主要是释放TransactionSynchronizationManager中的NamedTheadLocal资源,即释放线程本地事务资源<br>另外事务同步器的suspend在事务本地资源释放前一步执行</font>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=8;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1652.5" y="1770" width="280" height="50" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-134" value="org.springframework.transaction.support.DefaultTransactionStatus" style="swimlane;startSize=20;" parent="1" vertex="1">
<mxGeometry x="-520" y="1100" width="480" height="180" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-135" value="<div><b>transaction</b> = {DataSourceTransactionManager$DataSourceTransactionObject@928}&nbsp; <font color="#007fff">//事务对象,本质是连接, 要么是新建的(对最外层事务总是新建),要么是从resouces NamedThreadLocal拿的,具体看传播行为类型</font></div><div>newTransaction = true<span style="white-space: pre">	</span><font color="#007fff">//是否是新建的事务(连接),被融合的事务和外部事务处理的有差别使用这两个参数区分处理</font></div><div>newSynchronization = true<span style="white-space: pre">	</span><font color="#007fff">//是否要为事务新创建事务同步器的NamedThreadLocal(要求事务非活跃状态)</font></div><div>readOnly = false<span style="white-space: pre">	</span><span style="white-space: pre">	</span><font color="#007fff">//是否是只读事务</font></div><div>debug = true</div><div><b>suspendedResources</b> = null<span style="white-space: pre">	</span><font color="#007fff">//被挂起的资源,即被挂起的事务(或称连接)</font></div><div><b>rollbackOnly</b> = false<span style="white-space: pre">	</span><font color="#007fff">//是否需要回滚的标志</font></div><div>completed = false</div><div><b>savepoint</b> = null</div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=10;" parent="t2Bh8Tgv82BLZMkkJCVr-134" vertex="1">
<mxGeometry y="20" width="480" height="160" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-143" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-138" target="t2Bh8Tgv82BLZMkkJCVr-142" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-138" value="if (definition != null &amp;&amp; definition.isReadOnly()) :&nbsp;<br>con.<b>setReadOnly</b>(true)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1372.5" y="2495" width="220" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-145" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-140" target="t2Bh8Tgv82BLZMkkJCVr-144" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-140" value="<div><font size="1">actualKey = TransactionSynchronizationUtils<br>.unwrapResourceIfNecessary(key)</font><br></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1382.5" y="2920" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-142" value="<font style="font-size: 9px">if (definition != null &amp;&amp; definition.getIsolationLevel() != TransactionDefinition.ISOLATION_DEFAULT) :&nbsp;<br>currentIsolation = con.getTransactionIsolation();<br></font><div style="font-size: 9px"><font style="font-size: 9px">previousIsolationLevel = currentIsolation;</font></div><div style="font-size: 9px"><font style="font-size: 9px"><span>				</span>con.<b>setTransactionIsolation</b>(definition.getIsolationLevel())</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1362.5" y="2560" width="240" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-144" value="<div><font size="1">Map&lt;Object, Object&gt; map = resources.get();<br></font><b>resources</b>.set(map);<br></div><div>map.put(actualKey, value)<br><font color="#007fff">即重新设置resources ThreadLocal,当前数据源到新建连接的映射</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1382.5" y="2980" width="240" height="60" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-149" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;curved=1;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-146" target="t2Bh8Tgv82BLZMkkJCVr-148" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3k61qGwMEzmhM3xupUGX-3" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-146" target="3k61qGwMEzmhM3xupUGX-2" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-146" value="Connection conn = DataSourceUtils.getConnection(ds)<br><font color="#cc0066">获取的是同一个连接么?是;<br>之所以要随时注意获取的是否是同一个连接是因为事务作用域是会话(即连接),要保证事务有效必须确保是在一个连接会话中<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="350" width="200" height="70" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-152" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-148" target="t2Bh8Tgv82BLZMkkJCVr-151" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-148" value="第1个更新操作:<br>创建Statement并执行prepare.executeUpdate()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="440" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-154" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-151" target="t2Bh8Tgv82BLZMkkJCVr-153" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-56" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-151" target="3tcmVddGPVW7wgybLThJ-55" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-151" value="savePoint = status.createSavepoint();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="800" y="500" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-156" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-153" target="t2Bh8Tgv82BLZMkkJCVr-155" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-153" value="第2个更新操作:<br>创建Statement并执行prepare.executeUpdate()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="680" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-161" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-155" target="t2Bh8Tgv82BLZMkkJCVr-160" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-155" value="模拟发生运行时异常<br>throw new RuntimeException("test");" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="740" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-79" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-157" target="3tcmVddGPVW7wgybLThJ-78" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-157" value="this.transactionManager.rollback(status)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="762.5" y="3380" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-163" value="Y<br>这里捕获异常<br>execute方法中<br>就不会捕获了,<br>除非再抛出" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-160" target="t2Bh8Tgv82BLZMkkJCVr-162" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-160" value="<font style="font-size: 8px">自行捕获异常?</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="840" y="800" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-51" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-162" target="3tcmVddGPVW7wgybLThJ-50" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-54" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="t2Bh8Tgv82BLZMkkJCVr-162" target="3tcmVddGPVW7wgybLThJ-52" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="t2Bh8Tgv82BLZMkkJCVr-162" value="捕获异常后可选择<br>处理措施" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1040" y="800" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-67" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-50" target="3tcmVddGPVW7wgybLThJ-66" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-50" value="status.rollbackToSavepoint(savePoint)<br><font color="#007fff">回滚到保存点</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1200" y="760" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-77" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-52" target="3tcmVddGPVW7wgybLThJ-76" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-52" value="status.setRollbackOnly()<br><font color="#007fff">说是手动触发回滚,只是设置了标志,</font><font color="#cc0066">看后面是怎么处理这个标志回滚的</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1200" y="840" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-58" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-55" target="3tcmVddGPVW7wgybLThJ-57" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-55" value="getSavepointManager()<br><font color="#007fff" style="font-size: 8px">事务对象实现了SavepointManager接口,所以这里获取的就是DataSourceTransactionObject对象</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1040" y="500" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-60" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-57" target="3tcmVddGPVW7wgybLThJ-59" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-57" value="createSavepoint()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1040" y="560" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-62" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-59" target="3tcmVddGPVW7wgybLThJ-61" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-59" value="conHolder = getConnectionHolderForSavepoint()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1280" y="560" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-65" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-61" target="3tcmVddGPVW7wgybLThJ-64" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-61" value="return conHolder.createSavepoint()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1280" y="620" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-63" value="JdbcTransactionObjectSupport" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=8;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1315" y="540" width="130" height="20" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-64" value="this.savepointCounter++<br>return <b>getConnection()</b>.<b>setSavepoint</b>(<br>SAVEPOINT_NAME_PREFIX + this.savepointCounter)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1520" y="615" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-69" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-66" target="3tcmVddGPVW7wgybLThJ-68" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-66" value="getSavepointManager()<br>.rollbackToSavepoint(savepoint)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1420" y="760" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-71" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-68" target="3tcmVddGPVW7wgybLThJ-70" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-68" value="conHolder = getConnectionHolderForSavepoint()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1640" y="760" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-73" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-70" target="3tcmVddGPVW7wgybLThJ-72" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-70" value="conHolder.getConnection()<br>.rollback((Savepoint) savepoint)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="1640" y="820" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-75" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-72" target="3tcmVddGPVW7wgybLThJ-74" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-72" value="conHolder.resetRollbackOnly()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1640" y="880" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-74" value="this.rollbackOnly = false" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1860" y="880" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-76" value="this.rollbackOnly = true;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1420" y="840" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-82" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-78" target="3tcmVddGPVW7wgybLThJ-81" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-78" value="processRollback(defStatus, false)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1002.5" y="3380" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-80" value="AbstractPlatformTransactionManager" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=9;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1017.5" y="3360" width="170" height="20" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-86" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-81" target="3tcmVddGPVW7wgybLThJ-85" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-29" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-81" target="xfdcjk_qxBO9EsxSu5Ji-28" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-81" value="triggerBeforeCompletion(status)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1242.5" y="3380" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-88" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-85" target="3tcmVddGPVW7wgybLThJ-87" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-90" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-85" target="3tcmVddGPVW7wgybLThJ-89" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-85" value="status.hasSavepoint()" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1282.5" y="3440" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-101" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-87" target="3tcmVddGPVW7wgybLThJ-97" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1522.5" y="3520" />
<mxPoint x="1652.5" y="3520" />
<mxPoint x="1652.5" y="3790" />
<mxPoint x="1342.5" y="3790" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-73" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-87" target="xfdcjk_qxBO9EsxSu5Ji-72" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-87" value="status.rollbackToHeldSavepoint()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1442.5" y="3450" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-92" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-89" target="3tcmVddGPVW7wgybLThJ-91" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-107" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-89" target="3tcmVddGPVW7wgybLThJ-106" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-89" value="<font style="font-size: 9px">status.isNewTransaction()</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1282.5" y="3540" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-102" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-91" target="3tcmVddGPVW7wgybLThJ-97" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1342.5" y="3680.0000000000005" as="targetPoint" />
<Array as="points">
<mxPoint x="1522.5" y="3620" />
<mxPoint x="1632.5" y="3620" />
<mxPoint x="1632.5" y="3790" />
<mxPoint x="1342.5" y="3790" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-71" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-91" target="xfdcjk_qxBO9EsxSu5Ji-70" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-91" value="doRollback(status)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1442.5" y="3550" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-37" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-97" target="xfdcjk_qxBO9EsxSu5Ji-36" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-118" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="3tcmVddGPVW7wgybLThJ-97" target="xfdcjk_qxBO9EsxSu5Ji-117" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-97" value="triggerAfterCompletion(status, TransactionSynchronization<br>.<font style="font-size: 8px">STATUS_ROLLED_BACK</font>)" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1242.5" y="3840" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-42" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-98" target="xfdcjk_qxBO9EsxSu5Ji-43" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1480" y="4060" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-98" value="finally:<br>cleanupAfterCompletion(status)<br><font color="#007fff">事务资源清理</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1242.5" y="4040" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-110" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-106" target="3tcmVddGPVW7wgybLThJ-108" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-109" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;strokeColor=#000000;" parent="1" source="3tcmVddGPVW7wgybLThJ-106" target="xfdcjk_qxBO9EsxSu5Ji-108" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-106" value="<font style="font-size: 9px">status.hasTransaction()</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1282.5" y="3630" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-118" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;curved=1;" parent="1" source="3tcmVddGPVW7wgybLThJ-108" target="3tcmVddGPVW7wgybLThJ-97" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1520" y="3700" />
<mxPoint x="1610" y="3700" />
<mxPoint x="1610" y="3790" />
<mxPoint x="1343" y="3790" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-120" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="3tcmVddGPVW7wgybLThJ-108" target="3tcmVddGPVW7wgybLThJ-121" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1682.5" y="3660.166666666667" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-108" value="<font><span style="font-size: 8px">if (status.<b>isLocalRollbackOnly</b>() || <b>isGlobalRollbackOnParticipationFailure</b>())&nbsp;</span><br><font color="#007fff"><span style="font-size: 8px">只是设置rollbackOnly=true,说我要回滚,实际回滚是给外部事务处理</span></font><br></font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1440" y="3635" width="160" height="50" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-33" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" parent="1" source="3tcmVddGPVW7wgybLThJ-121" target="xfdcjk_qxBO9EsxSu5Ji-32" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="3tcmVddGPVW7wgybLThJ-121" value="doSetRollbackOnly(status);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1682.5" y="3640" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-1" value="<b>测试Demo:<br></b>事件传播行为:SpringTransactionPropagationExample" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="260" y="200" width="360" height="120" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=7;fontColor=#007FFF;curved=1;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-3" target="xfdcjk_qxBO9EsxSu5Ji-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-8" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-3" target="xfdcjk_qxBO9EsxSu5Ji-7" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="900" y="1440" />
<mxPoint x="900" y="1360" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-16" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-3" target="xfdcjk_qxBO9EsxSu5Ji-13" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-17" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-3" target="xfdcjk_qxBO9EsxSu5Ji-14" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-18" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-3" target="xfdcjk_qxBO9EsxSu5Ji-15" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-3" value="事务传播类型?" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="800" y="1400" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-5" value="<span style="font-size: 10px">PROPAGATION_NEVER<br><font color="#007fff">外部存在事务直接抛异常</font><br></span>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="919.5" y="1260" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-10" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-7" target="xfdcjk_qxBO9EsxSu5Ji-9" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-7" value="<font><span style="font-size: 10px">PROPAGATION_NOT_SUPPORTED<br></span><font color="#007fff"><span style="font-size: 10px">外部存在事务先挂起,然后直接返回null事务的状态对象</span></font></font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="919.5" y="1340" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-12" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=7;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-9" target="xfdcjk_qxBO9EsxSu5Ji-11" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-9" value="<span style="font-size: 10px">suspendedResources = <b>suspend</b>(transaction)</span>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1119.5" y="1340" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-21" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-11" target="xfdcjk_qxBO9EsxSu5Ji-20" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-11" value="<div><span style="font-size: 10px"><b>prepareTransactionStatus</b>(</span></div><div><span style="font-size: 10px">definition, <b>null</b>, false, newSynchronization, debugEnabled, suspendedResources)</span></div>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1099.5" y="1400" width="210" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-13" value="<font><span style="font-size: 10px"><b>PROPAGATION_REQUIRES_NEW</b></span><br></font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="918.5" y="1420" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-14" value="<font><b><span style="font-size: 10px">PROPAGATION_NESTED</span><br></b><font color="#007fff"><span style="font-size: 10px">借助保存点实现,TODO</span></font><br></font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="919.5" y="1500" width="170" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-27" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-15" target="xfdcjk_qxBO9EsxSu5Ji-26" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-15" value="<span style="font-size: 10px">PROPAGATION_SUPPORTS or <b>PROPAGATION_REQUIRED</b></span><br><font color="#007fff" style="font-size: 8px">外部存在事务直接返回对外部事务封装的新的状态对象</font>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="919.5" y="1580" width="170" height="50" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-19" value="<div style="font-size: 8px"><font style="font-size: 8px">transactionSynchronization默认是SYNCHRONIZATION_ALWAYS</font></div><div style="font-size: 8px"><font style="font-size: 8px">什么用???<br>源码注释说总是激活事务同步,即便返回的是空事务。</font></div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=7;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1089" y="2060" width="271" height="50" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-24" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-20" target="xfdcjk_qxBO9EsxSu5Ji-23" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-20" value="<div><font style="font-size: 9px">&nbsp;status = <b>newTransactionStatus</b>(</font></div><div>				<font style="font-size: 9px">definition, transaction, newTransaction, newSynchronization, debug, suspendedResources)</font></div>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1357.5" y="1400" width="210" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-23" value="<span style="font-size: 10px"><b>prepareSynchronization</b>(status, definition);<br></span>return status;" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1357.5" y="1460" width="210" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-26" value="<span style="font-size: 10px"><b>prepareTransactionStatus</b>(definition, <b>transaction</b>, false, <b>newSynchronization</b>, debugEnabled, null)</span>" style="whiteSpace=wrap;html=1;fontSize=9;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1119.5" y="1585" width="200.5" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-69" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-28" target="xfdcjk_qxBO9EsxSu5Ji-68" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-28" value="if (status.isNewSynchronization()):<br>TransactionSynchronizationUtils.triggerBeforeCompletion()<br><font color="#007fff">要求是新绑定的事务同步器才触发</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1480" y="3380" width="270" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-31" value="<div style="text-align: left ; font-size: 10px"><span>比如</span><span>PROPAGATION_REQUIRED,外部已有事务的情况下,对内层来说这里status(就是外部事务的status)内部不是新绑定的事务同步器,而是用的外部事务的事务同期器,内部当然不能执行,否则回到外部会再执行一次就重复了</span></div>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=8;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="1480" y="3320" width="280" height="50" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-62" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-32" target="xfdcjk_qxBO9EsxSu5Ji-61" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-32" value="DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.<b>getTransaction</b>()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1880" y="3640" width="180" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-40" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=9;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-34" target="xfdcjk_qxBO9EsxSu5Ji-39" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-34" value="synchronizations = TransactionSynchronizationManager<br>.getSynchronizations()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1640" y="3840" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-38" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-36" target="xfdcjk_qxBO9EsxSu5Ji-34" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-36" value="<font style="font-size: 9px">status<br>.isNewSynchronization()<br><font color="#007fff">同样需要判断是否是<br>新事务同步器</font><br></font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1480" y="3830" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-106" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-39" target="xfdcjk_qxBO9EsxSu5Ji-105" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="xfdcjk_qxBO9EsxSu5Ji-107" value="这不重复了么?上面的应该可以删掉" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=9;fontColor=#007FFF;strokeColor=#97D077;" parent="1" source="xfdcjk_qxBO9EsxSu5Ji-39" target="xfdcjk_qxBO9EsxSu5Ji-48" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1840" y="4060" />
<mxPoint x="1900" y="4060" />
<mxPoint x="1900" y="4180" />
</Array>