Skip to content
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

Fixed possible IDataReader existing after connection closing #266

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Anisimova2020
Copy link
Contributor

В тестах в проекте NewPlatform.Flexberry.ORM.ODataService возникли проблемы с работой тестов под .Net 8 в MS SQL Server.

Ошибка указала на

System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)
at System.Data.SqlClient.SqlInternalTransaction.Rollback()
at System.Data.SqlClient.SqlInternalTransaction.Dispose(Boolean disposing)
at System.Data.SqlClient.SqlInternalTransaction.Dispose()
at System.Data.SqlClient.SqlTransaction.Dispose(Boolean disposing)
at ICSSoft.STORMNET.Business.DbTransactionWrapper.Dispose()
at ICSSoft.STORMNET.Business.SQLDataService.LoadObjects(LoadingCustomizationStruct customizationStruct, Object& state, DataObjectCache dataObjectCache).

В ходе исследования фрагмента кода было выявлено, что в методе действительно формируется IDataReader, который потенциально может быть не закрыт. Добавлено закрытие.

@Anisimova2020 Anisimova2020 self-assigned this Oct 24, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant