I have an application with the architecture like client/server/db. Communication between client and server is WCF (has been migrated from asmx) and database is SQL Server 2005.
The project has a requirement, that you cannot update an order, which have been changed (updated) by another user after your initial read. A common requirement in most applications I think.
An update of an order is usually as:
- Client read an order - an initially-read copy is stored (Session) on the server
- Client updates order - returns updated-order to server
- Server will read order again from database and compare with initially-read to check, if order has been changed by another user - in case client will be notified to re-read order
- Server will save changes
This way to handle data change has the effect, that at a certaint point (3), the server will have 3 (different) copies of the order in memory! Anyone knows another strategy for this?
We are running WCF with AspNetBackwardCompability, because we need the Session-variable to "hold" the initially-read copies - it will make my day, if we could dump that