T
Toni
Hello folks,
Overview:
We use optimistic concurrency scheme for our database accesss. (We use
timestamp on all of our tables)
Since the data that are currently in memory (dataset) may not be the most
updated one, we anticipate that concurrency problems when we want to update
the database (UPDATE and DELETE) would likely to happen.
What we want is to catch the concurrency violation and ask the user if
he/she wants to overwrite the more current data with the older ones that
currenly in the dataset or abort the operation and reload the dataset.
Working with one table, everything works fine.
But with more than one table things work differently.
For example there are two tables: table A and table B.
(database access always use ado.net transaction)
Updating TableA failed, we got the exception, rollback transaction, ask the
user if he/she wants to overwrite the data.
if the user says yes, we write the data by ignoring timestamp comparison.
if the user says no, we just abort the whole thing.
Updating TableA succeed, TableB failed, we got exception, rollback
transaction, ask the user if he/she wants to overwrite the data.
if the user says yes, we write the data by ignoring timestamp comparison,
but for tableA we got another concurrency violation yet for tableB the
update was a success.
That's pretty strange to me.
I don't know ADO.NET that much thus the way I handle Concurrency problems
may not be the most efficient one.
I don't know if anbody has done the things that I want to accomplish.
Thanks in advance,
-Toni
Overview:
We use optimistic concurrency scheme for our database accesss. (We use
timestamp on all of our tables)
Since the data that are currently in memory (dataset) may not be the most
updated one, we anticipate that concurrency problems when we want to update
the database (UPDATE and DELETE) would likely to happen.
What we want is to catch the concurrency violation and ask the user if
he/she wants to overwrite the more current data with the older ones that
currenly in the dataset or abort the operation and reload the dataset.
Working with one table, everything works fine.
But with more than one table things work differently.
For example there are two tables: table A and table B.
(database access always use ado.net transaction)
Updating TableA failed, we got the exception, rollback transaction, ask the
user if he/she wants to overwrite the data.
if the user says yes, we write the data by ignoring timestamp comparison.
if the user says no, we just abort the whole thing.
Updating TableA succeed, TableB failed, we got exception, rollback
transaction, ask the user if he/she wants to overwrite the data.
if the user says yes, we write the data by ignoring timestamp comparison,
but for tableA we got another concurrency violation yet for tableB the
update was a success.
That's pretty strange to me.
I don't know ADO.NET that much thus the way I handle Concurrency problems
may not be the most efficient one.
I don't know if anbody has done the things that I want to accomplish.
Thanks in advance,
-Toni