In some books the implementation of Data Mappers simply update the whole row of a table using the data inside an object, but in a system is possible that two different operations update different fields from a same row in a database, which can make an update simply overwrite another one if both of them retrieve the old version of the row and try to update it. How can I solve this problem? I thought about using an Identity Map inside my Mapper and store the state of the object when they get to the application from the database and just update the fields that changed. Is this a good solution or am I overlooking something?
How to prevent updating unchanged date using Data Mappers?
design patterns;architecture;domain driven design;enterprise architecture;architectural patterns