I am a longtime user of the DevExpress XPO library. It has many great features, but there are a few drawbacks:
- When saving an existing object, all properties are sent in the update request; changes are tracked for each object, not for properties.
- Optimistic locking is performed for each object, not for a column.
- When an optimistic blocking exception occurs, no context is provided describing the nature of the conflict; your only real answer is to disable the operation or to reproduce it and try again in a loop.
- LINQ support for XPQuery is very weak (at least in version 8.1, which we use). Thus, you are often forced to use XPView, which is not type safe, or XPCollection, which can return columns that you do not need.
After reading how LINQ to SQL implements optimization of locking and handling update conflicts, I was sold! I like the way it implements optimistic locking at the column level and does not require adding a column to the table. The ability to verify and process the exact nature of conflicts is great. And the fact that they track changes in columns should significantly improve the efficiency of update requests.
Of course, I have not used LINQ to SQL in real applications yet, so I don’t know that it really compares. In addition, I do not understand if it has analogues for some functions that we like with XPO, for example:
- Automatic schema updates (we believe that in the structure of objects that control the structure of the database, and not vice versa, this greatly simplifies software deployment).
- Two options for implementing inheritance (relations between tables or one-to-one)
- Memory storage support (although I suppose we could replace LINQ with objects in our unit tests)
- Configure the storage provider (which allowed us to add NOLOCK support for our XPO requests)
, ORM . - XPO LINQ to SQL? ? , - , LINQ to SQL, ?
, LINQ Entities? , , .