PC Review


Reply
Thread Tools Rate Thread

DB2 and OLEDBDataReader

 
 
Dirk Behnke
Guest
Posts: n/a
 
      5th Jan 2006
I have a very strange problem:
I'm connecting ok to a DB2 database
The I'm executing several SQL commands using OleDBDataReader which works
fine.
I'm closing only the reader not the connection after each Reader operation.
Exactly the 1327th ExecuteReader operation triggeres a
NullReferenceException.
Then I close the connection, open it again and the ExecuteReader works!
However again ExecuteReader 1327 -> NullReferenceException.

Any help suggestions?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TXJTbWVyc2g=?=
Guest
Posts: n/a
 
      6th Jan 2006
First what version of DB2 you are attempting to use. There are subtle
differences between the iSeries version and the Windows one.

At first glimpse I will try my hand with another data provider, from my
observation on DB2 some are very sensible to the disposing order. First
dispose the reader then the command.
And there are few data providers available form IBM, Microsoft and others,
some native others ODBC and even OleDB. But be warned that providers have
their own idiosyncrasies (in fact you have bumped on one from the OleDB one).


"Dirk Behnke" wrote:

> I have a very strange problem:
> I'm connecting ok to a DB2 database
> The I'm executing several SQL commands using OleDBDataReader which works
> fine.
> I'm closing only the reader not the connection after each Reader operation.
> Exactly the 1327th ExecuteReader operation triggeres a
> NullReferenceException.
> Then I close the connection, open it again and the ExecuteReader works!
> However again ExecuteReader 1327 -> NullReferenceException.
>
> Any help suggestions?
>

 
Reply With Quote
 
Dirk Behnke
Guest
Posts: n/a
 
      6th Jan 2006
MrSmersh wrote:
> First what version of DB2 you are attempting to use. There are subtle
> differences between the iSeries version and the Windows one.
>
> At first glimpse I will try my hand with another data provider, from my
> observation on DB2 some are very sensible to the disposing order. First
> dispose the reader then the command.
> And there are few data providers available form IBM, Microsoft and others,
> some native others ODBC and even OleDB. But be warned that providers have
> their own idiosyncrasies (in fact you have bumped on one from the OleDB one).
>
>
> "Dirk Behnke" wrote:
>
>
>>I have a very strange problem:
>>I'm connecting ok to a DB2 database
>>The I'm executing several SQL commands using OleDBDataReader which works
>>fine.
>>I'm closing only the reader not the connection after each Reader operation.
>>Exactly the 1327th ExecuteReader operation triggeres a
>>NullReferenceException.
>>Then I close the connection, open it again and the ExecuteReader works!
>>However again ExecuteReader 1327 -> NullReferenceException.
>>
>>Any help suggestions?
>>

I'm using DB2 8.1 on Windows
 
Reply With Quote
 
=?Utf-8?B?TXJTbWVyc2g=?=
Guest
Posts: n/a
 
      7th Jan 2006
Ok for this version IBM has released a .Net native provider.
I suggest to try and use him instead of OleDB one, it will be certainly
faster, and as far as I know if you respect the destruction order work fine
even in very demanding applications.
This is what I will recommend, the coding effort is minimal since are booth
implementing the same interface.

Otherwise you will need to isolate the sequence of events that lead to your
problem and see if a problem in your code (try extended exception information
and the database logs) and if not try to avoid that sequence of operations.

"Dirk Behnke" wrote:

> MrSmersh wrote:
> > First what version of DB2 you are attempting to use. There are subtle
> > differences between the iSeries version and the Windows one.
> >
> > At first glimpse I will try my hand with another data provider, from my
> > observation on DB2 some are very sensible to the disposing order. First
> > dispose the reader then the command.
> > And there are few data providers available form IBM, Microsoft and others,
> > some native others ODBC and even OleDB. But be warned that providers have
> > their own idiosyncrasies (in fact you have bumped on one from the OleDB one).
> >
> >
> > "Dirk Behnke" wrote:
> >
> >
> >>I have a very strange problem:
> >>I'm connecting ok to a DB2 database
> >>The I'm executing several SQL commands using OleDBDataReader which works
> >>fine.
> >>I'm closing only the reader not the connection after each Reader operation.
> >>Exactly the 1327th ExecuteReader operation triggeres a
> >>NullReferenceException.
> >>Then I close the connection, open it again and the ExecuteReader works!
> >>However again ExecuteReader 1327 -> NullReferenceException.
> >>
> >>Any help suggestions?
> >>

> I'm using DB2 8.1 on Windows
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OleDbDataReader and strings Jerome Microsoft C# .NET 0 6th Mar 2006 10:26 AM
OleDbCommand and OleDbDataReader Nathan Franklin Microsoft Dot NET Compact Framework 1 14th Jan 2006 10:32 AM
OleDbDataReader =?Utf-8?B?TmV4dXM=?= Microsoft ADO .NET 2 29th Sep 2004 08:33 PM
OleDbDataReader =?Utf-8?B?TmV4dXM=?= Microsoft VB .NET 3 29th Sep 2004 12:41 PM
OleDbDataReader ???? Darryn Ross Microsoft C# .NET 1 30th Jul 2004 07:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:01 AM.