M
master
Actually, it is not only the record locking, what I need, and nobody seems
to descibe this.
Imagine the following scenario.
There is a database with, say 10000 records with some unvalidated data. And
there is an Intranet ASP.NET application which is an interface to the
database in question... and there are 100 pretty girls eager to... uhmm...
use the application and validate the data of course ;-).
The task is to enable the data validation in such a way that two girls NEVER
get the same record for validation (it is just a waste of time). When a girl
presses 'next' or something like that, she gets the access to an unvalidated
(and not being validated) record. This is more than pessimistic locking,
actually. And I missed the most important part - all this has to work
smoothly ;-).
I am thinking about a few solutions to this problem, I developed one once,
actually, basing on DB transactions with highest isolation level, but this
was not very smooth. Anyway, if anybody can give me a good advice or direct
to a good article, I will be very grateful.
Keep in mind that I might use synchronisation NOT on the DB level, but on
the level of the web application... maybe this would be faster?
Specifically, I think that I might keep a specialised locking object, say
"theLocker" in the application cache, to keep the hashtable with locked
records and users that locked them and incorporate some logic on this
hashtable.
I would use something like (I am writing in C#):
lock (theLocker) {
// lock / unlock the desired record
}
This is just an idea... what do you think about it?
Any comments will be welcome
DW.
to descibe this.
Imagine the following scenario.
There is a database with, say 10000 records with some unvalidated data. And
there is an Intranet ASP.NET application which is an interface to the
database in question... and there are 100 pretty girls eager to... uhmm...
use the application and validate the data of course ;-).
The task is to enable the data validation in such a way that two girls NEVER
get the same record for validation (it is just a waste of time). When a girl
presses 'next' or something like that, she gets the access to an unvalidated
(and not being validated) record. This is more than pessimistic locking,
actually. And I missed the most important part - all this has to work
smoothly ;-).
I am thinking about a few solutions to this problem, I developed one once,
actually, basing on DB transactions with highest isolation level, but this
was not very smooth. Anyway, if anybody can give me a good advice or direct
to a good article, I will be very grateful.
Keep in mind that I might use synchronisation NOT on the DB level, but on
the level of the web application... maybe this would be faster?
Specifically, I think that I might keep a specialised locking object, say
"theLocker" in the application cache, to keep the hashtable with locked
records and users that locked them and incorporate some logic on this
hashtable.
I would use something like (I am writing in C#):
lock (theLocker) {
// lock / unlock the desired record
}
This is just an idea... what do you think about it?
Any comments will be welcome
DW.