Last active
August 3, 2017 01:03
-
-
Save EgorBo/e49bf46bffbcb9e2932c251c8221ba69 to your computer and use it in GitHub Desktop.
bug.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data.SqlClient; | |
namespace sqldata | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
for (int i = 0; i < 200; i++) | |
{ | |
var conn = new SqlConnection(@"Server=192.168.0.107\SQLEXPRESS;Database=testo;User Id=sa;Password=qwerty123;"); | |
conn.Open(); | |
Console.WriteLine(i); | |
GC.Collect(); //should close connection (but doesn't do it under mono) | |
} | |
Console.WriteLine("done"); | |
//.NET 4.6 windows - OK | |
//.NET Core windows & macOS - OK | |
//MONO macOS - throws an exception at i=99 - no connections in the connection pool | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment