Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2963

UnsupportedOperationException with retryable writes

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.8.2
    • Affects Version/s: 3.6.0
    • Component/s: Write Operations
    • None

      I am getting UnsupportedOperationException when using retryable writes with col.findOneAndUpdate(find, update, new FindOneAndUpdateOptions().returnDocument(AFTER)).

      java.lang.UnsupportedOperationException: null
      	at com.mongodb.internal.connection.NoOpSessionContext.advanceTransactionNumber(NoOpSessionContext.java:63)
      	at com.mongodb.operation.BaseFindAndModifyOperation.addTxnNumberToCommand(BaseFindAndModifyOperation.java:129)
      	at com.mongodb.operation.FindAndUpdateOperation$1.create(FindAndUpdateOperation.java:365)
      	at com.mongodb.operation.CommandOperationHelper$4.call(CommandOperationHelper.java:451)
      	at com.mongodb.operation.OperationHelper.withReleasableConnection(OperationHelper.java:419)
      	at com.mongodb.operation.CommandOperationHelper.executeRetryableCommand(CommandOperationHelper.java:445)
      	at com.mongodb.operation.BaseFindAndModifyOperation.execute(BaseFindAndModifyOperation.java:69)
      	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:193)
      	at com.mongodb.client.internal.MongoCollectionImpl.executeFindOneAndUpdate(MongoCollectionImpl.java:743)
      	at com.mongodb.client.internal.MongoCollectionImpl.findOneAndUpdate(MongoCollectionImpl.java:723) 

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            lukas.krecan@liftago.com Lukáš Křečan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: