File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
test/functional/com/mongodb/client Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -117,11 +117,11 @@ public interface ClientSession extends com.mongodb.session.ClientSession {
117
117
* Execute the given function within a transaction.
118
118
*
119
119
* @param <T> the return type of the transaction body
120
- * @param options the transaction options
121
120
* @param transactionBody the body of the transaction
121
+ * @param options the transaction options
122
122
* @return the return value of the transaction body
123
123
* @mongodb.server.release 4.0
124
124
* @since 3.11
125
125
*/
126
- <T > T withTransaction (TransactionOptions options , TransactionBody <T > transactionBody );
126
+ <T > T withTransaction (TransactionBody <T > transactionBody , TransactionOptions options );
127
127
}
Original file line number Diff line number Diff line change @@ -179,11 +179,11 @@ private void unpinServerAddressOnError(final MongoException e) {
179
179
180
180
@ Override
181
181
public <T > T withTransaction (final TransactionBody <T > transactionBody ) {
182
- return withTransaction (TransactionOptions .builder ().build (), transactionBody );
182
+ return withTransaction (transactionBody , TransactionOptions .builder ().build ());
183
183
}
184
184
185
185
@ Override
186
- public <T > T withTransaction (final TransactionOptions options , final TransactionBody <T > transactionBody ) {
186
+ public <T > T withTransaction (final TransactionBody <T > transactionBody , final TransactionOptions options ) {
187
187
notNull ("transactionBody" , transactionBody );
188
188
long startTime = ClientSessionClock .INSTANCE .now ();
189
189
outer :
Original file line number Diff line number Diff line change @@ -354,13 +354,13 @@ public Void execute() {
354
354
}
355
355
});
356
356
} else {
357
- nonNullClientSession (clientSession ).withTransaction (transactionOptions , new TransactionBody <Object >() {
357
+ nonNullClientSession (clientSession ).withTransaction (new TransactionBody <Object >() {
358
358
@ Override
359
359
public Void execute () {
360
360
executeOperations (arguments .getDocument ("callback" ).getArray ("operations" ), true );
361
361
return null ;
362
362
}
363
- });
363
+ }, transactionOptions );
364
364
}
365
365
} else if (operationName .equals ("targetedFailPoint" )) {
366
366
assertTrue (failPoint == null );
You can’t perform that action at this time.
0 commit comments