@@ -33,48 +33,6 @@ public async Task Submit_Should_Succeed()
33
33
Assert . Equal ( "succeed" , status ) ;
34
34
}
35
35
36
- [ Fact ]
37
- public async Task DoAndSubmit_Should_DbTrans_Exception ( )
38
- {
39
- var provider = ITTestHelper . AddDtmGrpc ( ) ;
40
- var transFactory = provider . GetRequiredService < IDtmTransFactory > ( ) ;
41
-
42
- var gid = "msgTestGid" + Guid . NewGuid ( ) . ToString ( ) ;
43
- var msg = transFactory . NewMsgGrpc ( gid ) ;
44
- var req = ITTestHelper . GenBusiReq ( false , false ) ;
45
- var busiGrpc = ITTestHelper . BuisgRPCUrl ;
46
-
47
- msg . Add ( busiGrpc + "/busi.Busi/TransIn" , req ) ;
48
- // do TransOut local, then TransIn with DTM.
49
- await Assert . ThrowsAsync < System . InvalidOperationException > ( async ( ) =>
50
- {
51
- // System.InvalidOperationException: A TransactionScope must be disposed on the same thread that it was created.
52
- //
53
- // System.InvalidOperationException
54
- // A TransactionScope must be disposed on the same thread that it was created.
55
- // at Dtmgrpc.MsgGrpc.DoAndSubmit(String queryPrepared, Func`2 busiCall, CancellationToken cancellationToken) in /home/yunjin/Data/projects/github/dtm-labs/client-csharp/src/Dtmgrpc/Msg/MsgGrpc.cs:line 110
56
-
57
- await msg . DoAndSubmit ( busiGrpc + "/busi.Busi/QueryPreparedMySqlReal" , async branchBarrier =>
58
- {
59
- MySqlConnection conn = getBarrierMySqlConnection ( ) ;
60
- await branchBarrier . Call ( conn , ( ) =>
61
- {
62
- Task task = this . LocalAdjustBalance ( conn , TransOutUID , - req . Amount , "SUCCESS" ) ;
63
- return task ;
64
- } ,
65
- TransactionScopeOption . Required ,
66
- IsolationLevel . ReadCommitted
67
- // , default TransactionScopeAsyncFlowOption.Suppress
68
- ) ;
69
- } ) ;
70
- } ) ;
71
-
72
- await Task . Delay ( 4000 ) ;
73
- var status = await ITTestHelper . GetTranStatus ( gid ) ;
74
- // The exception did not affect the local transaction commit
75
- Assert . Equal ( "succeed" , status ) ;
76
- }
77
-
78
36
[ Fact ]
79
37
public async Task DoAndSubmit_Should_Succeed ( )
80
38
{
@@ -98,8 +56,7 @@ await branchBarrier.Call(conn, () =>
98
56
return task ;
99
57
} ,
100
58
TransactionScopeOption . Required ,
101
- IsolationLevel . ReadCommitted ,
102
- TransactionScopeAsyncFlowOption . Enabled ) ;
59
+ IsolationLevel . ReadCommitted ) ;
103
60
} ) ;
104
61
105
62
await Task . Delay ( 2000 ) ;
0 commit comments