Newbie questions - Data consistency

  • Thread starter Thread starter nick_nw
  • Start date Start date
N

nick_nw

Hi,

What techniques/machanisms are available in ADO.Net to ensure that
prior to a user committing an update they are working with the latest
data? E.g.

One DB, multiple user connections. Users datasets are refreshed
manually by user. User works with data and commits change (presumably
within the context of a Transaction). How can I be sure that when the
user has committed the change they are still viewing the latest data,
i.e. has any other user nipped in and made a quick change?

DB is Oracle 9/10i behind server.

Thanks in advance.
 
Nick,

If it is about New than it is obvious there cannot be data in the database
with that key.
For the Modify and Delete holds the DataSet always the original data it is
filled with.
You can test (the commandbuilder and the by wizard created code does that
automaticly) if that original data has not changed. In version 2.0 you can
do that more selective.

I hope that you get the idea?

Cor
 
Cor said:
Nick,

If it is about New than it is obvious there cannot be data in the database
with that key.
For the Modify and Delete holds the DataSet always the original data it is
filled with.
You can test (the commandbuilder and the by wizard created code does that
automaticly) if that original data has not changed. In version 2.0 you can
do that more selective.

I hope that you get the idea?

Cor

Thanks. Yes it will always be for existing data so I don't need to
worry about the New scenario.

So, what you're saying is that I should check back with the DB before
allowing the user to commit the transaction to ensure that the data
hasn't changed since they last refreshed?

Thanks,

Nick
 
If you are using the Update method on the DataAdapter, you do not have to
check, as the Update will complain if there is a problem with underlying
data changes.

Look up concurrency and ADO.NET. Dino Esposito has written many good
articles on concurrency that should help you tailor your application to
protect against two people editing the same data. Follow his advice and you
will be fine.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
Cowboy said:
If you are using the Update method on the DataAdapter, you do not have to
check, as the Update will complain if there is a problem with underlying
data changes.

Look up concurrency and ADO.NET. Dino Esposito has written many good
articles on concurrency that should help you tailor your application to
protect against two people editing the same data. Follow his advice and you
will be fine.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************

Thanks, now I've got the right word (concurrency) I'll be able to find
what I'm after. Cheers.
 
Back
Top