mongodbtransactionsdatabase-migrationmongock

Mongock "Wrong parameter [ClientSession]. Dependency not found" error


I'm trying to run the standalone-mongodb-sync example (https://github.com/mongock/mongock-examples/tree/master/mongodb) in the Mongock examples directory with mongodb-v3-driver. The only documentation about Client Session that I could find on Mongock documentation (https://docs.mongock.io/v5/driver/mongodb-sync/index.html) is that it is used to facilitate Mongodb transactions, and should be passed as an argument into the @execution method for each ChangeUnit. I could not find anything on where we can specify it as a parameter/dependency, according to the error.

Any advice on how to resolve this, or where to look?


Solution

  • Is there any specific reason you are using Mongodb 3.x driver?

    This will get fixed by using the 4.x instead, it seems there is a bug in the Mongock driver for 3.x.

    Anyway, there will be a new release for driver 3.x with this bugfix today.