-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Workflow Type #15953
Update Workflow Type #15953
Conversation
src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs
Show resolved
Hide resolved
// Use existing session connection. Do not use 'using' or dispose the connection. | ||
var connection = await _session.CreateConnectionAsync(); | ||
var workflowTypeIdsWithInstances = (await connection.QueryAsync<string>(sqlBuilder.ToSqlString(), param: null, _session.CurrentTransaction)).ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look OK but how do they fix the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it did or not. The issue in production happens randomly which is really hard to reproduce. But this is the only suspicious code since it's the only place to try to reuse the current connection. In production, the issue seems to happen when we list the workflow types. I think the fact we could be writing data to the current transaction and then read on the same connection seems that we should be passing the transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, OK, this won't hurt, but I really don't see what here would fix the exception. BTW this might be related: #15290.
@Piedone I am not sure if this is going to fix the issue we are seeing. But I think we should pass the current transaction to that query because the Query may flush any data associated with that transaction.
Unless you see an issue here, I would like to take this change and test it out. It's not easy to detect the problem since it's not consistent.