I know this question has been raised multiple times with some solutions but not sure where my problem fits in.
Based on my requirement, a user can create column on fly. For that, I am storing columns in some master table afterwards generating schema based on persistent types and then again re-generating context from artificial types kept under same master table.
Sometime back I had posted example(which is solved now) on
When I add new column and do insert, it's working fine but failing on update with error:
Telerik.OpenAccess.Exceptions.OptimisticVerificationException: Row not found: GenericOID@94811dfa TestTable Id=2
UPDATE [TestTable] SET [ContactName] = ?, [EndDate] = ?, [StartDate] = ?, [Test] = ?, [Test1] = ?, [Test3] = ?, [Test4] = ? WHERE [Id] = ? AND [ContactName] = ? AND [EndDate] = ? AND [StartDate] = ? AND [Test] = ? AND [Test1] = ? AND [Test3] = ? AND [Test4] = ?
(set event logging to all to see parameter values)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
Few things, that I have already tried:
- Making column nullable. [http://www.telerik.com/forums/optimisticverificationexception-in-case-of-a-derived-class-looks-like-a-bug
- The persistent objects are generated on the fly so I have used SaveChanges(ConcurrencyConflictsProcessingMode.AggregateAll)
but not working.[http://docs.telerik.com/data-access/feature-reference/api/context-api/feature-ref-api-context-api-managing-concurrency
Points that I am following:
- Using fluent mapping.
- New DbContext is initialized for each operation. (in this case insert or update are getting new context)
Please let me know if any further explanation is required or if I have missed something.