You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
publicasyncTaskPersistWorkflow(WorkflowInstanceworkflow,List<EventSubscription>subscriptions,CancellationTokencancellationToken=default){if(subscriptions==null||subscriptions.Count<1){awaitPersistWorkflow(workflow,cancellationToken);return;}using(varsession=await_database.Client.StartSessionAsync(cancellationToken:cancellationToken)){session.StartTransaction();//<---- this throwsawaitPersistWorkflow(workflow,cancellationToken);awaitEventSubscriptions.InsertManyAsync(subscriptions,cancellationToken:cancellationToken);awaitsession.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)
The text was updated successfully, but these errors were encountered:
Yeah that's what I did for my local MongoDB instance for testing. I guess leave it as it is and maybe add a comment in the docs that you'll need a cluster or replica set for working-core to work on MongoDB.
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 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:
The text was updated successfully, but these errors were encountered: