Multi-client access: good practice
-
This is a very subjective beginner question... Suppose I have two different applications that access the same database, and I want them both to use the most recent data... how should I do it? Should I clear and refill my whole dataset every time I access data? Should I use remoting between the two applications in order to notify each other of what row to reload (this seems complicated!)? By the way I work in disconnected mode with Typed datasets. I'd appreciate if you gave me some pointers. Thank you!
-
This is a very subjective beginner question... Suppose I have two different applications that access the same database, and I want them both to use the most recent data... how should I do it? Should I clear and refill my whole dataset every time I access data? Should I use remoting between the two applications in order to notify each other of what row to reload (this seems complicated!)? By the way I work in disconnected mode with Typed datasets. I'd appreciate if you gave me some pointers. Thank you!
Applications informing each other about changes to data doesn't sound like a good idea. You haven't stated what database system or programming languages you are using. If you are using, SQL Server 2005 and .NET, Query Notification[^] may be of interest to you.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
This is a very subjective beginner question... Suppose I have two different applications that access the same database, and I want them both to use the most recent data... how should I do it? Should I clear and refill my whole dataset every time I access data? Should I use remoting between the two applications in order to notify each other of what row to reload (this seems complicated!)? By the way I work in disconnected mode with Typed datasets. I'd appreciate if you gave me some pointers. Thank you!
goldoche wrote:
I want them both to use the most recent data
You can never have the most recent data. As soon as you have retrieved it, it is potentially out of date. That said, you then have to decide how out-of-date you are willing to allow the data to be. You'll have to have some way of dealing with concurrency violation, that is, where another user has modified the data since it was read. One approach, that used by the DataSet's update feature by default (IIRC), is to compare all the field values against the values that were retrieved and if different, to fail the update.
DoEvents: Generating unexpected recursion since 1991