bjacobs wrote:
I have a timestamp column in all of my tables. I did this initially because I was using LINQ and it was recommended to me for checking concurrency. However, since I am using LLBLGen and since I handle concurrency issues differently (i.e I lock the record so that only one user can edit at a time), is there any other benefit for keeping this field.
Hi Billy. As a matter of fact your Timesatmp filed is perfect for concurrency control. Check this docs link to know how to implement concurrency control in LLBLGen.
bjacobs wrote:
I ask this because I am continually getting EntityOutOfSync exceptions. I believe the cause of this is due some asynchronous methods which save entity data on a different thread and it happens just after this. Also, I have hard coded the calls to SaveEntity to always refetch to try to solve the problem, which has been unsuccessful. The only field that would ever be out of sync would be the timestamp field. To resolve this I wanted to add the following to my config file <add key="markSavedEntitiesAsFetched" value="true"> but in the post that suggests this, it specifically mentions a timestamp field as a reason not to use this.
You have to check where these OurOfSync errors come from. Usually this is because you save an entity without refetching it and then you try to access its properties. markSavedEntitiesAsFetched does the trick but you really don't get the updated values after save.