Hi @viktorshevchenko210
After #1079 is merged (release v3.7.0) WorkflowCore.Persistence.MongoDB does not allow stand alone MongoDb servers due to addition of transaction support.
Issue in this file : workflow-core/src/providers/WorkflowCore.Persistence.MongoDB/Services/MongoPersistenceProvider.cs for method public async Task PersistWorkflow(WorkflowInstance workflow, List<EventSubscription> subscriptions, CancellationToken cancellationToken = default)
Reproduce:
Persist workflow which contains more than one subscriptions so that if (subscriptions == null || subscriptions.Count < 1) is not true.
Result
The line session.StartTransaction() in below method throws:
public async Task PersistWorkflow(WorkflowInstance workflow, List<EventSubscription> subscriptions, CancellationToken cancellationToken = default)
{
if (subscriptions == null || subscriptions.Count < 1)
{
await PersistWorkflow(workflow, cancellationToken);
return;
}
using (var session = await _database.Client.StartSessionAsync(cancellationToken: cancellationToken))
{
session.StartTransaction(); //<---- this throws
await PersistWorkflow(workflow, cancellationToken);
await EventSubscriptions.InsertManyAsync(subscriptions, cancellationToken: cancellationToken);
await session.CommitTransactionAsync(cancellationToken);
}
}
The exception:
System.NotSupportedException: Standalone servers do not support transactions.
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)
Hi @viktorshevchenko210
After #1079 is merged (release v3.7.0)
WorkflowCore.Persistence.MongoDBdoes not allow stand alone MongoDb servers due to addition of transaction support.Issue in this file :
workflow-core/src/providers/WorkflowCore.Persistence.MongoDB/Services/MongoPersistenceProvider.csfor methodpublic async Task PersistWorkflow(WorkflowInstance workflow, List<EventSubscription> subscriptions, CancellationToken cancellationToken = default)Reproduce:
Persist workflow which contains more than one subscriptions so that
if (subscriptions == null || subscriptions.Count < 1)is not true.Result
The line
session.StartTransaction()in below method throws:The exception: