logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Huge memory consumed with myOdbc and VB.NET: msg#00003

db.mysql.odbc

Subject: Huge memory consumed with myOdbc and VB.NET



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









<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo