@@ -126,7 +126,7 @@ public synchronized void reset()
126
126
if ( currentTransaction != null )
127
127
{
128
128
currentTransaction .markToClose ();
129
- updateLastBookmarkFrom ( currentTransaction );
129
+ setBookmark ( currentTransaction . bookmark () );
130
130
currentTransaction = null ;
131
131
}
132
132
if ( currentConnection != null )
@@ -179,10 +179,7 @@ public synchronized Transaction beginTransaction()
179
179
@ Override
180
180
public synchronized Transaction beginTransaction ( String bookmark )
181
181
{
182
- if ( bookmark != null )
183
- {
184
- setBookmark ( bookmark );
185
- }
182
+ setBookmark ( bookmark );
186
183
return beginTransaction ();
187
184
}
188
185
@@ -203,7 +200,10 @@ public <T> T writeTransaction( TransactionWork<T> work )
203
200
// is a valid requirement for some test scenarios.
204
201
void setBookmark ( String bookmark )
205
202
{
206
- this .bookmark = bookmark ;
203
+ if ( bookmark != null )
204
+ {
205
+ this .bookmark = bookmark ;
206
+ }
207
207
}
208
208
209
209
@ Override
@@ -230,7 +230,7 @@ public synchronized void onTransactionClosed( ExplicitTransaction tx )
230
230
if ( currentTransaction != null && currentTransaction == tx )
231
231
{
232
232
closeCurrentConnection ();
233
- updateLastBookmarkFrom ( currentTransaction );
233
+ setBookmark ( currentTransaction . bookmark () );
234
234
currentTransaction = null ;
235
235
}
236
236
}
@@ -395,14 +395,6 @@ private void closeCurrentConnection( boolean sync )
395
395
}
396
396
}
397
397
398
- private void updateLastBookmarkFrom ( ExplicitTransaction tx )
399
- {
400
- if ( tx .bookmark () != null )
401
- {
402
- bookmark = tx .bookmark ();
403
- }
404
- }
405
-
406
398
private static List <Throwable > recordError ( Throwable error , List <Throwable > errors )
407
399
{
408
400
if ( errors == null )
0 commit comments