Server version 3.6.0 does not support the Transactions feature

Hi,

I use Azure Cosmos DB with Mongo DB (Mongo DB .Net Driver to connect). I would like to utilize a transaction feature but when I try to do this (calling session.StartTransaction()) I get following error:

Server version 3.6.0 does not support the Transactions feature.

Stack trace looks like this:

at MongoDB.Driver.Core.Misc.Feature.ThrowIfNotSupported(SemanticVersion serverVersion)
at MongoDB.Driver.Core.Bindings.CoreSession.EnsureTransactionsAreSupported()
at MongoDB.Driver.Core.Bindings.CoreSession.EnsureStartTransactionCanBeCalled()
at MongoDB.Driver.Core.Bindings.CoreSession.StartTransaction(TransactionOptions transactionOptions)
at MongoDB.Driver.Core.Bindings.WrappingCoreSession.StartTransaction(TransactionOptions transactionOptions)
at MongoDB.Driver.Core.Bindings.WrappingCoreSession.StartTransaction(TransactionOptions transactionOptions)
at MongoDB.Driver.ClientSessionHandle.StartTransaction(TransactionOptions transactionOptions)

Have enyone else experienced similar problem? I couldn’t find any information about this problem.

Welcome to the community @Sylwester_Jarosinski!

The general error message is correct: multi-document transaction support was added for replica set deployments in MongoDB 4.0 and extended to sharded clusters in MongoDB 4.2.

However, please note that Cosmos’ API is an emulation of MongoDB which differs in features, compatibility, and implementation from an actual MongoDB deployment. Cosmos’ suggestion of API version support (eg 3.6) is referring to the wire protocol version rather than the full MongoDB feature set associated with that server version. Official MongoDB drivers (like .NET) are only tested against actual MongoDB deployments.

If you’d like to try transactions in MongoDB, you can get started using a free cluster on MongoDB Atlas. Atlas clusters can be deployed in Azure, AWS, and Google Cloud Platform. Atlas free tier clusters include 512MB of storage, and can be scaled up to larger clusters more suitable for production apps.

Regards,
Stennie