Hello I'm not able to report a bug via connect (because everything is japenese when I select .Net Framework ... and my japanese isn't the best) so I landed here.
I'm experiencing a handle leak when
- using SqlConnection
- to connect to a Sql Server via TCP
- with MARS (Multiple Active Resultsets) enabled
- only with a x86 app (x64 doesn't show this behavior)
- only on framework 4.5.2 (also on 4.5.3/4.6 - don't know the correct name)
- large amount of data has to be selected
Obviously when reducing the packet size (within connection string) the handle count increases; with larger packet size the handles also get wasted but not so much.
When observing the app with process explorer it shows nameless handles of type 'Event'.
Does anyone else experience this behavior?
Sample code: Has to be executed multiple times (depending of data amount)using (SqlConnection conn = new SqlConnection(@"packet size=32768;server=tcp:[AnyServer];Connection Timeout=30;database=[AnyDatabase];Trusted_Connection=true;Pooling=true;MultipleActiveResultSets=true;")) { conn.Open(); using (SqlCommand cmd = new SqlCommand("select * from [SomeTable]", conn)) { using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { // Do something } } } }