Bug #6920 The connections persists
Submitted: 1 Dec 2004 16:18 Modified: 7 Dec 2004 16:42
Reporter: Abraham Echenique Carta Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.2 OS:Windows (Win XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[1 Dec 2004 16:18] Abraham Echenique Carta
Description:
Using the .Net connector with Vb.Net 2003 the opened connections persists inclusive if the commands Connection.Close() or Connection.Dispose() are executed. This connections may be viewed using the MySQL Administrator in Server Connections view.

How to repeat:
Create a new Windows project in Vb.Net and type the follow instructions:

Imports MySql.Data.MySqlClient
...
Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load

    Dim oConn As New MySqlConnection("Host=localhost;")
    oConn.Open()

    Dim oCmd As New MySqlCommand("SHOW DATABASES", oConn)
    Dim oDr As MySqlDataReader = oCmd.ExecuteReader

    oDr.Close()
    oConn.Close()
End Sub

Run the project: Notice that in MySQL Administrator the connection is active pressing the "refresh" button.
Now, close the form: Notice that in MySQL Administrator the connection downs, pressing the "refresh" button.
[7 Dec 2004 16:42] Reggie Burnett
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

What you are seeing is connection pooling.  To disable this feature, add pooling=false to your connection string.