MTrinder wrote:
Yes, you need to ensure that the process which updates the counter value occurs in a serializable transaction, to ensure that no other process can update it at the same time. You also need to use some sort of optimistic concurrency on the record so that you can ensure that the value has not been updated since you retrieved it.
Matt
Isolation Levels always trip me up. So, if I did an UpdateEntitiesDirectly and set the Counter column to an expression that does the calculation (select count(transId) from transaction where dealid = xx), do I still need to mess with the Isolation level or can I leave it as its default isolation level?
Is the serialized level to guard against as I perform the 'select count(...' in the expression, no other transactions can insert records into the transaction table?
Also, are serializable transactins dangerous (deadlocks, etc.)? It should be a quick update to one table