Sahil
Sat Jan 29 13:41:08 CST 2005
Rodolfo,
If timestamps were the best way to do it, then other techniques wouldn't
exist. Oracle has an equivalent rowid (I think), but keeping the future in
mind, I like option#3 the best.
You could implement pessimistic locking through datasets, but you'll have to
try very hard to do it :). Either way, it's not the effort, and I don't see
any good reason for an OLTP application to implement pessimistic locking.
- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
"Rodolfo" <rua17@hotmail.com> wrote in message
news:envF30VBFHA.2608@TK2MSFTNGP10.phx.gbl...
> It seems that Timestamps are the less time consuming technique rigth?, I
> guess the options 2 and 3 applied to an big table (in terms of columns)
> can be very tedious. Can I implemente pessimistic locking with DataSets?,
> I beleave I saw some article that it said that you can't
>
> TIA
>
> "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> news:uXaSfcNBFHA.3140@TK2MSFTNGP15.phx.gbl...
>> Rodolfo,
>>
>> First you need to decide on the concurrency model you choose.
>>
>> 1. Timestamps?
>> 2. Check for all values.
>> 3. Check for values you are updating?
>> 4. Pessimistic locking (last choice).
>>
>> Each of the above can be supported by the dataset natively. Timestamps
>> will let require you to query for the timestamp before data is sent to
>> the UI layer. #2 and #3 can be checked for by using original values of
>> the particular columns you are planning to update.
>>
>> You can also use the above along with any one of the 4 (5 in 2.0/sql2k5)
>> isolation levels on transactions specific to the exact behavior you need.
>>
>> In a good architecture though, all this should be abstracted out in the
>> data layer.
>>
>> - Sahil Malik
>>
http://dotnetjunkies.com/weblog/sahilmalik
>>
>>
>>
>> "Rodolfo" <rua17@hotmail.com> wrote in message
>> news:u8dxWgLBFHA.3528@tk2msftngp13.phx.gbl...
>>> Hi, I'm creating the arquitecture of a N tiers application, at the
>>> moment I decided to use classes to inherit from Dataset in order to
>>> represent the Data Entities.
>>>
>>> However I hit the concurrency problem and I'm not sure how to prevent it
>>> (timestamps, sp, etc.) Can anyone recomend me a good strategy to manage
>>> concurrency?
>>>
>>> TIA
>>>
>>
>>
>
>