File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -35,24 +35,24 @@ protected override void OnCommit(Enlistment enlistment)
35
35
36
36
protected override void OnRollback ( Enlistment enlistment )
37
37
{
38
- ExecuteXaCommand ( "END" ) ;
39
- ExecuteXaCommand ( "ROLLBACK" ) ;
40
- }
41
-
42
- private void ExecuteXaCommand ( string statement )
43
- {
44
- using var cmd = Connection . CreateCommand ( ) ;
45
- cmd . CommandText = "XA " + statement + " " + m_xid ;
46
38
try
47
39
{
48
- cmd . ExecuteNonQuery ( ) ;
40
+ ExecuteXaCommand ( "END" ) ;
41
+ ExecuteXaCommand ( "ROLLBACK" ) ;
49
42
}
50
43
catch ( MySqlException ex ) when ( ex . ErrorCode is MySqlErrorCode . XARBDeadlock )
51
44
{
52
45
// ignore deadlock when rolling back
53
46
}
54
47
}
55
48
49
+ private void ExecuteXaCommand ( string statement )
50
+ {
51
+ using var cmd = Connection . CreateCommand ( ) ;
52
+ cmd . CommandText = "XA " + statement + " " + m_xid ;
53
+ cmd . ExecuteNonQuery ( ) ;
54
+ }
55
+
56
56
private static int s_currentId ;
57
57
58
58
private string ? m_xid ;
You can’t perform that action at this time.
0 commit comments