[Mono-list] Re: Npgsql doesn't work anymore

Jaroslaw Kowalski jaak@zd.com.pl
Sat, 20 Mar 2004 11:47:49 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_009D_01C40E71.2B79C370
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Sorry, obviously I forgot to add the diff.

Jarek

----- Original Message ----- 
From: "Jaroslaw Kowalski" <jaak@zd.com.pl>
To: "Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br>;
<mono-list@ximian.com>
Sent: Friday, March 19, 2004 10:02 PM
Subject: Re: [Mono-list] Re: Npgsql doesn't work anymore


> I've made some tests. My new diff is attached (I've added two WriteLine's,
> one of them never was never executed).
>
> The output is:
>
> ----
> ZZZ ServerVersion:  False
> _serverVersion is null
> -----
>
> Hope it helps.
>
> BTW. I've tried to add "MaxPoolSize=0" to the CS but it just caused the
> connection to hang.
>
> Jarek
>
> ----- Original Message ----- 
> From: "Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br>
> To: "Jaroslaw Kowalski" <jaak@zd.com.pl>; <mono-list@ximian.com>
> Sent: Friday, March 19, 2004 9:35 PM
> Subject: [Mono-list] Re: Npgsql doesn't work anymore
>
>
> > --- Jaroslaw Kowalski <jaak@zd.com.pl> escreveu:
> > >
> > > I'm using Fedora Core 1 with "postgresql-server-7.3.4-11" installed
from
> RPM
> > > and Npgsql (from Mono/CVS) doesn't work for me (while it used to work
> > > properly about one month ago).
> > >
> > > I get "System.NullReferenceException : Object reference not set to an
> > > instance of an object" when connecting. The problem seems to occur in
> > > NpgsqlConnection.ProcessServerVersion().
> > >
> >
> >
> > >
> > >              if (BackendProtocolVersion == ProtocolVersion.Version2)
> > >              {
> > >
> > >
> > > and it prints "_serverVersion is null". It obviously fails on
> > > _serverVersion.IndexOf() right after that.
> > >
> > > My ConnectionString is:
> > >
> > > 'Server=fw.home.lan;Initial Catalog=SoodaUnitTests;User
> > > Id=mono;Password=mono'
> > >
> > > I can provide more debug info but I don't know what exactly is needed
> here.
> > > Any ideas?
> >
> >
> > Hi Jaroslaw.
> >
> > I'm checking that.
> > In my nunit tests here I'm not getting this problem.
> > We had this problem some time ago, but we already fixed it. But may
there
> is
> > some case which is still getting problems.
> >
> > In the Open method, near its end, and before the call to
> ProcessServerVersion
> > there is a line:
> >
> > ServerVersion = Connector.ServerVersion;
> >
> > Could you check what is the value of ServerVersion when this code
> executes?
> >
> > Also, a little bit above, is where we set the Connector.ServerVersion.
> Could
> > you also check what value is being set?
> >
> > Thanks in advance.
> >
> > Regards,
> >
> > Francisco Figueiredo Jr.
> >
> >
> >
> >
> >
> >
> >
> > ______________________________________________________________________
> >
> > Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
> > http://br.yahoo.com/info/mail.html
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>

------=_NextPart_000_009D_01C40E71.2B79C370
Content-Type: application/octet-stream;
	name="npgsql.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="npgsql.diff"

Index: NpgsqlConnection.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /mono/mcs/class/Npgsql/Npgsql/NpgsqlConnection.cs,v=0A=
retrieving revision 1.16=0A=
diff -u -r1.16 NpgsqlConnection.cs=0A=
--- NpgsqlConnection.cs	13 Mar 2004 14:15:23 -0000	1.16=0A=
+++ NpgsqlConnection.cs	19 Mar 2004 21:59:30 -0000=0A=
@@ -465,6 +465,7 @@=0A=
                     Connector.ServerVersion =3D ServerVersion;=0A=
                     Connector.BackendProtocolVersion =3D =
BackendProtocolVersion;=0A=
                     Connector.Encoding =3D connection_encoding;=0A=
+					Console.WriteLine("AAA ServerVersion: {0} {1}", ServerVersion, =
ServerVersion !=3D null);=0A=
                     =0A=
                 }=0A=
                                 =0A=
@@ -473,6 +474,7 @@=0A=
                 =0A=
                 connection_state =3D ConnectionState.Open;=0A=
                 ServerVersion =3D Connector.ServerVersion;=0A=
+				Console.WriteLine("ZZZ ServerVersion: {0} {1}", ServerVersion, =
ServerVersion !=3D null);=0A=
                 BackendProtocolVersion =3D =
Connector.BackendProtocolVersion;=0A=
                 Encoding =3D Connector.Encoding;=0A=
                 =0A=
@@ -633,6 +635,11 @@=0A=
             NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, =
"ProcessServerVersion");=0A=
             // FIXME: Do a better parsing of server version to avoid=0A=
             // hardcode version numbers.=0A=
+			//=0A=
+			if (_serverVersion =3D=3D null)=0A=
+			{=0A=
+				Console.WriteLine("_serverVersion is null");=0A=
+			}=0A=
 =0A=
             if (BackendProtocolVersion =3D=3D ProtocolVersion.Version2)=0A=
             {=0A=

------=_NextPart_000_009D_01C40E71.2B79C370--