Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 83B676333CA for ; Tue, 12 Jan 2010 01:09:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38855-07 for ; Tue, 12 Jan 2010 05:09:18 +0000 (UTC) X-Greylist: delayed 05:34:48.599562 by SQLgrey-1.7.6 Received: from s007.panelboxmanager.com (s007.panelboxmanager.com [72.55.186.10]) by mail.postgresql.org (Postfix) with ESMTP id D047D63266E for ; Tue, 12 Jan 2010 01:09:17 -0400 (AST) Received: from 75-119-251-59.dsl.teksavvy.com ([75.119.251.59] helo=intranet.sem.ca) by s007.panelboxmanager.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NUTmG-0004uR-8p for pgsql-odbc@postgresql.org; Mon, 11 Jan 2010 18:34:28 -0500 Received: from [192.168.0.8] (laurent [192.168.0.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: laurent) by intranet.sem.ca (Postfix) with ESMTPSA id B0C2452E071 for ; Mon, 11 Jan 2010 18:30:56 -0500 (EST) Message-ID: <4B4BB581.3050302@sem.ca> Date: Mon, 11 Jan 2010 18:34:25 -0500 From: Laurent Chouinard User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b2pre Thunderbird/3.0 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: C# w/ ODBC, 2.1 million list select gives empty DataSet X-Enigmail-Version: 1.0 X-Stationery: 0.5 Content-Type: multipart/alternative; boundary="------------030405070903000609090100" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s007.panelboxmanager.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sem.ca X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.59 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/4 X-Sequence-Number: 10167 This is a multi-part message in MIME format. --------------030405070903000609090100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi everyone, I've been using the ODBC driver for Windows along with my C# (Framework 2.0) for a few years now and it's been working very nicely. Until now. One of my customer's database has grown to considerable size over time, and in particular, one report he attemps to do in my software gives an empty report. Upon investigation, I determined that the SELECT I send to the postgresql gets processed properly and it probably hands over about 2.1 million rows as the response. After that, I use the "Fill" method as instructed in the "HOW TO" section in the ODBC documentation to fill the data into a DataSet object. After considerable amount of work (almost the same as when I do that same query in PgAdmin III, about 110 seconds), the DataSet gets initialized empty, with zero tables in it. No errors, no exceptions. Everything moves along as if nothing happened. I just upgraded to the latest ODBC drivers (dated december 2009) and it's not changing my issue. Am I hitting a limit of some sort? I played with the "ConnectionTimeout" values of OdbcCommand and OdbcDataAdapter, didn't seem to change. Here's a selected sample of the code I use: OdbcCommand odcQuery = new OdbcCommand(sSQLQuery); using (OdbcConnection dbcPostGresConnection = new OdbcConnection(_dpDBSettings.GetConnectionString())) { try { odcQuery.Connection = dbcPostGresConnection; dbcPostGresConnection.Open(); switch (emCurrentType) { case emSqlQueryType.CREATE: case emSqlQueryType.DELETE: case emSqlQueryType.UPDATE: case emSqlQueryType.INSERT: case emSqlQueryType.ALTER: case emSqlQueryType.DROP: { _kNumberOfAffectedRecordsFromLastQuery = odcQuery.ExecuteNonQuery(); break; } case emSqlQueryType.SELECT: { OdbcDataAdapter oddaDatasetFiller = new OdbcDataAdapter(odcQuery); oddaDatasetFiller.Fill(_dsLastResults); if (_dsLastResults.Tables.Count > 0) { _kNumberOfAffectedRecordsFromLastQuery = _dsLastResults.Tables[0].Rows.Count; } break; } } _bLastQuerySucceeded = true; } catch... etc all possible catches ahead. Anyone has a suggestion or ideas? I've searched the web, mailing lists and documentation as I could, nothing seems to be said about this particular issue. One interseting thing I might add, I was previously using a very old ODBC driver, from 2006. This one caused an exception on the .Fill() method, which was "ERROR [HY000] Out of memory while reading tuples". Now I'm assuming that since I upgraded to the new driver, not having this exception means that I'm not running out of memory anymore, right? Even more details: with the original 2006 drivers, I could see my application (the .EXE) climb up to 700MB of private bytes/virtual size in Task Manager until eventually crashing and then not releasing that memory. So initially, I was investigating a memory leak issue. With the new drivers, it still climbs to 700MB or so (makes sense, 2 million rows is quite a bit), and then after the "0 rows" returned, memory is cleared immediately. Makes sense as well, OBDC doesn't carry data anymore, dataset is almost null, garbage collector is having a field day. Thanks for any suggestions or input from anyone. Regards, Laurent Chouinard SEM Logo Laurent Chouinard laurent.chouinard@sem.ca SEM inc. 3610 Valiquette, St-Laurent, QC, H4S 1X8 Tel: 514-334-7569 / 1-888-334-7569 Fax: 514-334-5922 --------------030405070903000609090100 Content-Type: multipart/related; boundary="------------030600020801090509060009" --------------030600020801090509060009 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi everyone,

I've been using the ODBC driver for Windows along with my C# (Framework 2.0) for a few years now and it's been working very nicely.

Until now.

One of my customer's database has grown to considerable size over time, and in particular, one report he attemps to do in my software gives an empty report.

Upon investigation, I determined that the SELECT I send to the postgresql gets processed properly and it probably hands over about 2.1 million rows as the response. After that, I use the "Fill" method as instructed in the "HOW TO" section in the ODBC documentation to fill the data into a DataSet object.

After considerable amount of work (almost the same as when I do that same query in PgAdmin III, about 110 seconds), the DataSet gets initialized empty, with zero tables in it. No errors, no exceptions. Everything moves along as if nothing happened.

I just upgraded to the latest ODBC drivers (dated december 2009) and it's not changing my issue.

Am I hitting a limit of some sort? I played with the "ConnectionTimeout" values of OdbcCommand and OdbcDataAdapter, didn't seem to change.

Here's a selected sample of the code I use:



            OdbcCommand odcQuery = new OdbcCommand(sSQLQuery);

            using (OdbcConnection dbcPostGresConnection = new OdbcConnection(_dpDBSettings.GetConnectionString()))
            {
                try
                {
                    odcQuery.Connection = dbcPostGresConnection;
                    dbcPostGresConnection.Open();

                    switch (emCurrentType)
                    {
                        case emSqlQueryType.CREATE:
                        case emSqlQueryType.DELETE:
                        case emSqlQueryType.UPDATE:
                        case emSqlQueryType.INSERT:
                        case emSqlQueryType.ALTER:
                        case emSqlQueryType.DROP:
                        {
                            _kNumberOfAffectedRecordsFromLastQuery = odcQuery.ExecuteNonQuery();
                            break;
                        }

                        case emSqlQueryType.SELECT:
                        {
                            OdbcDataAdapter oddaDatasetFiller = new OdbcDataAdapter(odcQuery);
                            oddaDatasetFiller.Fill(_dsLastResults);
                           
                            if (_dsLastResults.Tables.Count > 0)
                            {
                                _kNumberOfAffectedRecordsFromLastQuery = _dsLastResults.Tables[0].Rows.Count;
                            }
                           
                            break;
                        }
                    }

                    _bLastQuerySucceeded = true;
                }
                catch... etc all possible catches ahead.



Anyone has a suggestion or ideas? I've searched the web, mailing lists and documentation as I could, nothing seems to be said about this particular issue.

One interseting thing I might add, I was previously using a very old ODBC driver, from 2006. This one caused an exception on the .Fill() method, which was "ERROR [HY000] Out of memory while reading tuples". Now I'm assuming that since I upgraded to the new driver, not having this exception means that I'm not running out of memory anymore, right?
   
Even more details: with the original 2006 drivers, I could see my application (the .EXE) climb up to 700MB of private bytes/virtual size in Task Manager until eventually crashing and then not releasing that memory. So initially, I was investigating a memory leak issue.

With the new drivers, it still climbs to 700MB or so (makes sense, 2 million rows is quite a bit), and then after the "0 rows" returned, memory is cleared immediately. Makes sense as well, OBDC doesn't carry data anymore, dataset is almost null, garbage collector is having a field day.

Thanks for any suggestions or input from anyone.

Regards,

Laurent Chouinard



SEM Logo Laurent Chouinard
laurent.chouinard@sem.ca
SEM inc.
3610 Valiquette, St-Laurent, QC, H4S 1X8
Tel: 514-334-7569 / 1-888-334-7569
Fax: 514-334-5922


--------------030600020801090509060009 Content-Type: image/g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LGdJy1ra0pYzmIEL5NCAEEjCAzJIAABcsIFiGvOYyEym MpfJzGY685nFdAEOfJnIRwQBADs= --------------030600020801090509060009-- --------------030405070903000609090100--