From: Kelly Baker <kbaker HOWARD-IND.COM>
>Normally I would agree with you. But in this case,
Connx acts as a
>database interface for our mainframe flatfiles. A query
with a
filter
>that may return only 40,000 records times out on the
mainframe
>before it is complete. I'll see the 40,000 records, but
the query
>would never end because of the mainframe timeout.
Unfortunately,
>I don't have the clout to make them upgrade from the
flatfiles to a
>database driven system or this would not be an issue.
So it's basically a communication timeout - you have time
to get a
little data but not a lot of data.
That means you want queries that return only a little data
and
process quickly on the mainframe.
Which means you'll be running many queries. You can do that
with one of three models:
(1) Open a connection, create a datareader, suck the data
out of
it, close the datareader, close the connection. (The
connection will
actually be held open for a while and reused if you try to
open
another connection with all the same attributes. This
happens
automatically, handled by the .Net runtimes, so don't worry
about
frequent opening and closing.) You'll only use one
connection per
user.
(2) Open a connection, create a datareader. Don't close
either until
you are done with that data. Get data from the datareader at
leisure.
You may have dozens of connections per user. Which may annoy
your system administrators.
(3) Open a connection, grab a dataset, close the connection.
Get
data from the dataset at leisure. You'll only use one
connection per
user.
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|