[Mono-bugs] [Bug 433908] New: Problem with Npsql and pooling

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 9 10:30:08 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=433908


           Summary: Problem with Npsql and pooling
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
        ReportedBy: informatique.internet at fiducial.fr
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


There's a problem with Npgsql 1.0 (bundled with mono) and pooling with mono 2.0 

This bug doesn't appear with ms.net nor with mono 1.9.*

description :

If you don't close explicitly a NpgsqlConnection, the connection should be
garbage collected if the connection is no more referenced...
but with mono 2.0, the underlying socket is well closed, but the connection is
always in the "used" connection pool... So we have leaks...
I've disabled pooling on our fiducial.biz production server because we had
error (the pool was full)

Small test case :


        class CnxContainer : System.ComponentModel.Component {
                private NpgsqlConnection _cnx;

                ~CnxContainer() {
                        Console.WriteLine("destroyed...");
                }
                public CnxContainer()
                {
                        _cnx=new NpgsqlConnection(cnxstring);
                        _cnx.Open();
                }
        }

        private static void gc_test() 
        {
                for (int i=0;i<100;i++){
                        CnxContainer cnx=new CnxContainer();
                        cnx=null;
                        GC.Collect();
                        Console.ReadLine();
                }
        }

I've a modified version of Npgsql with logs... 
On mono 2-0 we haveGetPooledConnector use:0 free:0

GetPooledConnector use:1 free:0
destroyed...

GetPooledConnector use:2 free:0
destroyed...

GetPooledConnector use:3 free:0



...




On mono 1.9 we have 

GetPooledConnector use:0 free:0

GetPooledConnector use:1 free:0
destroyed...

GetPooledConnector use:2 free:0

destroyed...

GetPooledConnector use:1 free:0

destroyed...

GetPooledConnector use:1 free:0
destroyed...


So we see that the connection is never released in mono 2.0


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list