Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Huge memory consumed with myOdbc and VB.NET

Huge memory consumed with myOdbc and VB.NET

2006-05-03       - By Patrik Lindvall

 Back
Reply:     1     2     3     4     5     6     7     8  



Hi All!

When using MyOdbc3.51.12 with VB.net(1.1) and filling a dataset from
table all available memory get consumed after a couple of 500 queries.

The problem only arises with tables that contains a huge amount of
records(>100000) and that leads me to the conclusion that the whole
table for some reason gets into odbcmemory, and performance is also
lousy.

The datatable in the dataset only contains the row from query (SELECT *
from XXX Where ID='1') and ID is primary KEY.



The problem only arises when Dataadapter.MissingSchemaAction =
MissingSchemaAction.AddWithKey is used in dataadapter, without  that
line the problem does not show!



The program runs without problem on 2003-server/wts and ordinary window
clients.

The problemserver is an 2003 windows server std edition SP1 citrix
metaframe (4.0.17-max-debug /odbc 3.51.12)



The program exits after 500 queries on dataadapter.fill with exception,
"Object reference not set to an instance of an object" and about 1.5 GB
memory is consumed!



Any help  on this issue is appreciated!



Regards

Patrik



Vb-code:

Imports System.Data.Odbc



Module Module1



   Private cn As OdbcConnection

   Private Dataadapter As OdbcDataAdapter



   Sub Main()

 

       Dim ds As New DataSet

       Dim sql As String

       Dim count as integer = 10000

       cn = New OdbcConnection("DSN=test")

       sql = "SELECT * FROM xxx where id= '1'"

       Try

           cn.Open()

           Dataadapter = New OdbcDataAdapter(sql, cn)

           Dataadapter.MissingSchemaAction =
MissingSchemaAction.AddWithKey  '*** When removing this line the isue
doesn't arise!!! ***

       Catch ex As Exception

           Console.WriteLine(ex.Message)

           Console.ReadLine()

           End

       End Try



       Do

           Try

               Dataadapter.Fill(ds, "table")

           Catch ex As Exception

               Console.WriteLine("Count:" & Count & vbCrLf &
ex.Message)

                     '"Object reference not set to an instance of an
object" after about 500 queries"

               Exit Do

           End Try

           'Do som work!



           If Count Mod 100 = 0 Then

               Console.Write(Count & ",(" & ds.Tables(0).Rows.Count &
")")

           End If

           ds.Tables("xxx").Clear()

           Count -= 1

       Loop Until Count <= 0

   End Sub



End Module