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 {
117117 * Execute the given function within a transaction.
118118 *
119119 * @param <T> the return type of the transaction body
120- * @param options the transaction options
121120 * @param transactionBody the body of the transaction
121+ * @param options the transaction options
122122 * @return the return value of the transaction body
123123 * @mongodb.server.release 4.0
124124 * @since 3.11
125125 */
126- <T > T withTransaction (TransactionOptions options , TransactionBody <T > transactionBody );
126+ <T > T withTransaction (TransactionBody <T > transactionBody , TransactionOptions options );
127127}
Original file line number Diff line number Diff line change @@ -179,11 +179,11 @@ private void unpinServerAddressOnError(final MongoException e) {
179179
180180 @ Override
181181 public <T > T withTransaction (final TransactionBody <T > transactionBody ) {
182- return withTransaction (TransactionOptions .builder ().build (), transactionBody );
182+ return withTransaction (transactionBody , TransactionOptions .builder ().build ());
183183 }
184184
185185 @ 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 ) {
187187 notNull ("transactionBody" , transactionBody );
188188 long startTime = ClientSessionClock .INSTANCE .now ();
189189 outer :
Original file line number Diff line number Diff line change @@ -354,13 +354,13 @@ public Void execute() {
354354 }
355355 });
356356 } else {
357- nonNullClientSession (clientSession ).withTransaction (transactionOptions , new TransactionBody <Object >() {
357+ nonNullClientSession (clientSession ).withTransaction (new TransactionBody <Object >() {
358358 @ Override
359359 public Void execute () {
360360 executeOperations (arguments .getDocument ("callback" ).getArray ("operations" ), true );
361361 return null ;
362362 }
363- });
363+ }, transactionOptions );
364364 }
365365 } else if (operationName .equals ("targetedFailPoint" )) {
366366 assertTrue (failPoint == null );
You can’t perform that action at this time.
0 commit comments