Rob wrote:
Hi guys
It has now been 14 years or so when I first started my project on LLBLGen Pro.
Back then, from memory, your documentation recommended that I would add a column to each table, call it Concurrency and give it the timestamp type.
My memory is very vague about this recommendation but I have kept this Concurrency column by type timestamp in many of my tables over the years.
An external programmer writing something for me right now is using EF and he is getting issues from the Concurrency column (ironically concurrency issues).
So I thought I should ask.
Does LLBLGen use the column Concurrency of type timestamp if it exists? Or, has that been removed over the years? Or... did it never and I misunderstood back then?
(Rob, please don't email us as well, if you posted here We see your posts, we'll answer within a day, no worries )
Our framework uses a concurrency factory, which you can define and which is used to automatically produce predicates of your choosing and which thus can check whatever field or fields you want. See: https://www.llblgen.com/Documentation/5.6/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Adapter/gencode_usingentityclasses_concurrency.htm
We don't say you should add a timestamp column, but it's a generic way to do this, as a timestamp column is updated if the row is updated (so no update to any field -> timestamp field isn't updated either), so if the timestamp value in the entity being updated is the same as in the row (which you can do with a predicate), you proceed (so the predicate should resolve to true in that case) or in the case of when they differ the predicate should result in false so the update fails and the transaction will roll back with a concurrency exception.
To be honest I don't know what EF does, also you don't specify what errors you got, so I can't go into that specifically. If you use our designer, you can use it to mark a field for concurrencycontrol, see: https://www.llblgen.com/Documentation/5.6/Entity%20Framework/V56/AvailableOutputSettings.htm#field-settings-value-type-definition-field-entity-definition-field
You can mark multiple fields at once using:
https://www.llblgen.com/Documentation/5.6/Designer/Functionality%20Reference/BulkOutputSettingValuesManipulator.htm
If a field is marked for concurrency in EF it's treated like that and isn't updated by EF when you save a row. I think that's the issue you run into?