Re: Syncronize dataset with database in multithreaded application.





"Jess Lundager Andersen" <JessLundagerAndersen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:47FAC310-46CE-444B-971B-3EDF05407C8A@xxxxxxxxxxxxxxxx
Hi
I have a multithreaded application that uses a typed dataset to held
configuration data. The configuration data is also stored in at database.
The dateset is send to the different threads using the byref keyword
From time to time i need to update the dataset in the application.
Using the fill method will work fine adding new rows to the dataset but
dont seem to work if a record has been removed from the database and there
for no longer should be in the dataset.
If I try to use the dataset.clear command before i use the load command it
works fine. But then i get rowerros arround in my application because the
refferenced rows no longer exists.

Do anyone have an idea how to update the dataset properly? without using the
clear method.


First you don't need byref. The DataSet is a reference type, so it's allways passed by reference.

The easiest pattern and most reliable pattern I know of for this is to simply replace your DataSet instance with a new one periodically. The clients will see the new data the next time they access the DataSet. Of course you need make sure client code doesn't cache the reference to the shared DataSet.

David

.



Relevant Pages

  • Persistency frameworks ?
    ... I am thinking about my configuration data, that resides in a database. ... rewrite of my class structure? ... Best way of syncing the data from the database and the one in any file ...
    (comp.programming)
  • Re: Help on proper method ????
    ... I do not need to keep syncronistaion of memeory with back end database ... becasue data which are pushed are configuration data that never change. ... Whnen a request is coming, I should be abvle to send back message 1, message ... If your memory cache is too ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: How to Perform SQL Select on a DataSet
    ... The closest similie to a Select on a dataset is to use a combination of ... These values are different depending on the installation. ... > I have re-created the database tables necessary into XML files and store ... > configuration data. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Web.config on load balanced servers
    ... But then of course you have a bootstrapping problem of how to tell each server what database to connect to. ... each server needs to be informed where to go look for your configuration data. ... config information in static classes or in the cache that someone ...
    (microsoft.public.dotnet.framework.aspnet)