.NETGURU
Intermittent Exception from System.Data
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.odbcnet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Hami Buckler via .Net Guru (VIP)
I have a number of functions which read 1000+ rows from AS400/DB2 tables through ODBC using ODBCDataReaders. Intermittently an error is written to the Windows Application Event Log with the source marked as System.Data and the message Invalid Handle! There is no other information. Immediately before this error is recorded an exception is encountered within one of my functions with the following information:

Exception Type: NullReferenceException

Exception : Object reference not set to an instance of an object.

Source : System.Data

Stack Trace :
at System.Data.Odbc.CMDWrapper.op_Implicit(CMDWrapper x)
at System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype, Int32 cb)
at System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C sqlctype)
at System.Data.Odbc.OdbcDataReader.internalGetInt64(Int32 i)
at System.Data.Odbc.OdbcDataReader.GetInt64(Int32 i)
at MyAssembly.Data.MyReader.ReadMyData(MyData myData)

The exception comes from an internal function within System.Data. My functions that experience this exception call the DB2 database through ODBC with a SQL statement ?SELECT x, y, z FROM MyTable? where ?x, y, z? are all fields which return Int64 or Long data values.

I have not been able to find out why this exception occurs intermittently and would be great full for any help.

-----------------------
Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

<Id>qY/9+tix/0qYe+2AJd0GZg==</Id>
Reply to this message...
 
    
Kingsley Idehen
8/4/2004 8:51:10 AM

"Hami Buckler via .Net Guru" <Click here to reveal e-mail address> wrote in
message

<#Click here to reveal e-mail address>

> I have a number of functions which read 1000+ rows from AS400/DB2
tables through ODBC using ODBCDataReaders. Intermittently an error
is written to the Windows Application Event Log with the source
marked as System.Data and the message Invalid Handle! There is no
other information. Immediately before this error is recorded an
exception is encountered within one of my functions with the
following information:

>

> Exception Type: NullReferenceException

>

> Exception : Object reference not set to an instance of an object.

>

> Source : System.Data

>

> Stack Trace :

> at System.Data.Odbc.CMDWrapper.op_Implicit(CMDWrapper x)

> at System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C
sqlctype, Int32 cb)

> at System.Data.Odbc.OdbcDataReader.GetData(Int32 i, SQL_C
sqlctype)

> at System.Data.Odbc.OdbcDataReader.internalGetInt64(Int32 i)

> at System.Data.Odbc.OdbcDataReader.GetInt64(Int32 i)

> at MyAssembly.Data.MyReader.ReadMyData(MyData myData)

>

> The exception comes from an internal function within System.Data.
My functions that experience this exception call the DB2 database
through ODBC with a SQL statement ?SELECT x, y, z FROM MyTable? where
?x, y, z? are all fields which return Int64 or Long data values.

>

> I have not been able to find out why this exception occurs
intermittently and would be great full for any help.

>

> -----------------------

> Posted by a user from .Net Guru (http://www.dot-net-guru.com/)

>

> <Id>qY/9+tix/0qYe+2AJd0GZg==</Id>

OpenLink Software provides an alternative ODBC.NET provider that
should alleviate this problem. You can easily test this hypothesis by
swapping out the default ODBC.NET provider from Microsoft, with the
one that we provide, and then repeat your tests. Our ODBC.NET
provider is available for download from: http://www.openlinksw.
com/download on a free 30 day evaluation basis.

We also provide an ODBC diagnostic utility called OpenLink ODBC Scan
that enables you to trace what is happening at the ODBC Layer (in
this case you can diagnose data excahange between the ODBC.NET
Provider and the underlying DB2 Driver).

Hope this helps.

Regards,

Kingsley Idehen Weblog: http://www.openlinksw.com" target="_blank">http://www.openlinksw.com/blog/~kidehen

OpenLink Software Web: http://www.openlinksw.com" target="_blank">http://www.openlinksw.com

Universal Data Access & Universal Integration Middleware Providers.
Reply to this message...
 
 
System.Data.Odbc.OdbcDataReader
System.NullReferenceException




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification