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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ DetailVariableDef.ViewGenerator = null; // or resolving of interface IViewGenera
8. Constructor of class `AuditService`.
9. Constructor of class `BusinessServerProvider`.


### Deprecated
1. `ExternalLangDef.LanguageDef` (correct way is creation of new instance of `ExternalLangDef` with proper DataService).
2. `UnityFactory`.
Expand All @@ -49,6 +48,7 @@ DetailVariableDef.ViewGenerator = null; // or resolving of interface IViewGenera
12. Getting of `CommandTimeout` throught configuration file.

### Fixed
1. Disposing of `IDataReader` during data loading at `SQLDataService`.

### Security

Expand Down
9 changes: 5 additions & 4 deletions ICSSoft.STORMNET.Business/SQLDataService/SQLDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1862,10 +1862,11 @@ public virtual object[][] ReadFirstByExtConn(string query, ref object state, int
myCommand.CommandText = query;
myCommand.Transaction = transaction;
CustomizeCommand(myCommand);

IDataReader myReader = myCommand.ExecuteReader();
state = new object[] { connection, myReader };
return ReadNextByExtConn(ref state, loadingBufferSize);
using (IDataReader myReader = myCommand.ExecuteReader())
{
state = new object[] { connection, myReader };
return ReadNextByExtConn(ref state, loadingBufferSize);
}
}
}
catch (Exception e)
Expand Down
Loading