File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Async/NHSpecificTest/GH1235 Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,12 @@ public async Task ShouldThrowStaleStateForOptimisticLockUpdateAsync()
118
118
119
119
result . OtherName += "x" ;
120
120
using ( var s2 = OpenSession ( ) )
121
- using ( var t2 = s2 . BeginTransaction ( ) )
122
121
{
123
122
var result2 = await ( s2 . Query < MultiTableEntity > ( ) . FirstOrDefaultAsync ( ) ) ;
124
123
result2 . OtherName += "y" ;
125
124
await ( t1 . CommitAsync ( ) ) ;
125
+
126
+ using ( var t2 = s2 . BeginTransaction ( ) )
126
127
Assert . That (
127
128
( ) => t2 . CommitAsync ( ) ,
128
129
_optimisticLock == null
@@ -151,11 +152,12 @@ public async Task ShouldThrowStaleStateForOptimisticLockDeleteAsync()
151
152
152
153
result . OtherName += "x" ;
153
154
using ( var s2 = OpenSession ( ) )
154
- using ( var t2 = s2 . BeginTransaction ( ) )
155
155
{
156
156
var result2 = await ( s2 . Query < MultiTableEntity > ( ) . FirstOrDefaultAsync ( ) ) ;
157
157
await ( s2 . DeleteAsync ( result2 ) ) ;
158
158
await ( t1 . CommitAsync ( ) ) ;
159
+
160
+ using ( var t2 = s2 . BeginTransaction ( ) )
159
161
Assert . That (
160
162
( ) => t2 . CommitAsync ( ) ,
161
163
_optimisticLock == null
Original file line number Diff line number Diff line change @@ -106,11 +106,12 @@ public void ShouldThrowStaleStateForOptimisticLockUpdate()
106
106
107
107
result . OtherName += "x" ;
108
108
using ( var s2 = OpenSession ( ) )
109
- using ( var t2 = s2 . BeginTransaction ( ) )
110
109
{
111
110
var result2 = s2 . Query < MultiTableEntity > ( ) . FirstOrDefault ( ) ;
112
111
result2 . OtherName += "y" ;
113
112
t1 . Commit ( ) ;
113
+
114
+ using ( var t2 = s2 . BeginTransaction ( ) )
114
115
Assert . That (
115
116
( ) => t2 . Commit ( ) ,
116
117
_optimisticLock == null
@@ -139,11 +140,12 @@ public void ShouldThrowStaleStateForOptimisticLockDelete()
139
140
140
141
result . OtherName += "x" ;
141
142
using ( var s2 = OpenSession ( ) )
142
- using ( var t2 = s2 . BeginTransaction ( ) )
143
143
{
144
144
var result2 = s2 . Query < MultiTableEntity > ( ) . FirstOrDefault ( ) ;
145
145
s2 . Delete ( result2 ) ;
146
146
t1 . Commit ( ) ;
147
+
148
+ using ( var t2 = s2 . BeginTransaction ( ) )
147
149
Assert . That (
148
150
( ) => t2 . Commit ( ) ,
149
151
_optimisticLock == null
You can’t perform that action at this time.
0 commit comments