E
EY
I've migrated a VB6 program to .NET. The VB program uses ADO
(Provider=OraOLEDB.Oracle) and the .NET program uses ADO.NET (same
provider). I know that ADO is different from ADO.NET, but I would like
to make the .NET program works the same as before (especially
performance).
In the VB program, the cursor location and type of the recordset are
not defined. So, I think it's server-side cursor and forward-only
(cache size and max row are not defined as well). What it does is to
execute a SELECT statement with a Command object and assign the result
to a global variable (recordset). Then, it executes a function with an
input parameter, nOutputRow, to output [nOutputRow] number of rows
from the recordset, i.e. it's doing paging whenever this function is
called. Therefore, read-only and forward-only is good enough. When
running a query that returns 50,000 records, it's fast because I think
it's concurrent, i.e. it can process data before all records are
returned.
In .NET, I tried to use data adapter but it's not concurrent. And if I
use data reader, it's concurrent but it doesn't allow me to perform
other database operations to the connection unless the data reader is
closed. In my application, I need to allow other operations before the
data reader is closed and I want to make sure I don't open too many
database connections.
Q1) How does ADO and ADO.NET do caching with the settings that I've
mentioned above? Are all the returned records cached to memory on the
database server/client?
Q2) What is the best way to make the .NET program work the same as
before (especially performance)?
Q3) If data reader is the best option, how can I manage the
connections?
Thanks in advance!
EY
(Provider=OraOLEDB.Oracle) and the .NET program uses ADO.NET (same
provider). I know that ADO is different from ADO.NET, but I would like
to make the .NET program works the same as before (especially
performance).
In the VB program, the cursor location and type of the recordset are
not defined. So, I think it's server-side cursor and forward-only
(cache size and max row are not defined as well). What it does is to
execute a SELECT statement with a Command object and assign the result
to a global variable (recordset). Then, it executes a function with an
input parameter, nOutputRow, to output [nOutputRow] number of rows
from the recordset, i.e. it's doing paging whenever this function is
called. Therefore, read-only and forward-only is good enough. When
running a query that returns 50,000 records, it's fast because I think
it's concurrent, i.e. it can process data before all records are
returned.
In .NET, I tried to use data adapter but it's not concurrent. And if I
use data reader, it's concurrent but it doesn't allow me to perform
other database operations to the connection unless the data reader is
closed. In my application, I need to allow other operations before the
data reader is closed and I want to make sure I don't open too many
database connections.
Q1) How does ADO and ADO.NET do caching with the settings that I've
mentioned above? Are all the returned records cached to memory on the
database server/client?
Q2) What is the best way to make the .NET program work the same as
before (especially performance)?
Q3) If data reader is the best option, how can I manage the
connections?
Thanks in advance!
EY