F
Francois Malgreve
Hi all,
I may post a stupid question on the newsrgoup but I am quite beginner with
ADO.NET
Anyway I read in the various papers speaking about ADO.NET is that the
DataSet is a important new improvement as you can work on it disconected and
then keep a disconnected cached version. In the literature on ADO.NET
everybody speaks about DataSet as a new miracle and dismiss the old fashion
way to just run a command object (Command).
Fine BUT what about the following scenario?
Let say I work in a multhi threaded environment, then Thread 1 populates a
DataSet and play with it. In the meantime Thread 2 modify some data on the
DB. Of course the DataSet in Thread 1 won' be aware of it then then the data
encapsulated in the DataSet will represent a wrong state on the Database.
Actually I asssume that this scenario could happen in a mono threaded
application if some event or any kind of code update some data in the DB
that is cached by the DataSet, here again the DataSet will NOT reflect the
state of the DB.
Idem for an ASP application, if some page use a cached DataSet in the
Session or even in the Viewstate (whatever it implies for performace reason)
but an other user change some data from somewhere else, the DataSet cached
would not reflect the actual status of the DB.
Then what? Did I miss something? DataSet seems to be what everybody is
using. Also it brings a lot of functionalities but if what I say is what
actually happen I cannot afford to use it eing afraid that it would bring
bugs as ny cached version of my rows may not reflect the actual state of the
DB. But in that case I would miss all the functionalities of the DataSet.
I could also use a DataSet as a Reader and dismiss it after i use it just to
be able to benefit its functionalities (but DataSet seems to be an expensive
object to keep being populated).
My main concern is that having 2 "versions" of my records (one in the DB and
one in the DataSet) make me things that many inconsistencies may happen...
Actually I would like to get back any comments on what I said, plus I would
like to know "When to use a Dataset " but more important "when to NOT use a
Dataset".
Thank you.
your confused programmer,
Francois
I may post a stupid question on the newsrgoup but I am quite beginner with
ADO.NET
Anyway I read in the various papers speaking about ADO.NET is that the
DataSet is a important new improvement as you can work on it disconected and
then keep a disconnected cached version. In the literature on ADO.NET
everybody speaks about DataSet as a new miracle and dismiss the old fashion
way to just run a command object (Command).
Fine BUT what about the following scenario?
Let say I work in a multhi threaded environment, then Thread 1 populates a
DataSet and play with it. In the meantime Thread 2 modify some data on the
DB. Of course the DataSet in Thread 1 won' be aware of it then then the data
encapsulated in the DataSet will represent a wrong state on the Database.
Actually I asssume that this scenario could happen in a mono threaded
application if some event or any kind of code update some data in the DB
that is cached by the DataSet, here again the DataSet will NOT reflect the
state of the DB.
Idem for an ASP application, if some page use a cached DataSet in the
Session or even in the Viewstate (whatever it implies for performace reason)
but an other user change some data from somewhere else, the DataSet cached
would not reflect the actual status of the DB.
Then what? Did I miss something? DataSet seems to be what everybody is
using. Also it brings a lot of functionalities but if what I say is what
actually happen I cannot afford to use it eing afraid that it would bring
bugs as ny cached version of my rows may not reflect the actual state of the
DB. But in that case I would miss all the functionalities of the DataSet.
I could also use a DataSet as a Reader and dismiss it after i use it just to
be able to benefit its functionalities (but DataSet seems to be an expensive
object to keep being populated).
My main concern is that having 2 "versions" of my records (one in the DB and
one in the DataSet) make me things that many inconsistencies may happen...
Actually I would like to get back any comments on what I said, plus I would
like to know "When to use a Dataset " but more important "when to NOT use a
Dataset".
Thank you.
your confused programmer,
Francois