The application can't know the data changes unless it constantly polls every record in memory for such changes. The amount of traffic to the database that generates would be potentially crippling to even the most powerful system.
Consider an application that has 20 million entities loaded (not a whole lot for a big system). Add the relationships to be maintained, you're potentially up to 50 million rows in the database. To ensure you always notice changes rapidly each of those would have to be polled maybe 10 times a second, for 500 million database operations per second, and 500 million object comparisons per second in the application (or else you'd need a stored procedure that performs those 500 million comparisons inside the database). At 4KB at least per network package, that's 2TB of network traffic per second you're generating.
Not a lot of networks would be able to handle such a load.
A far better solution is to refresh a managed entity before trying to update it, and notify the user interface if there have been changes at database level from the state it had before the update request.
|