This question is locked. New answers and comments are not allowed.
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
http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=836147
http://www.telerik.com/account/ClientsFiles/ae8a07d5-d53a-40fe-9db6-3e937ea7db4e_ArtificialChangeTrackingV2.zip?accesskey=480EE467CF8E75A090468BF8DF8CB21DC2EF19EC&expires=635537024668437583
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.ExceptionWrapper.Throw()
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit()
at Telerik.OpenAccess.OpenAccessContextBase.SaveChanges()
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.
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
http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=836147
http://www.telerik.com/account/ClientsFiles/ae8a07d5-d53a-40fe-9db6-3e937ea7db4e_ArtificialChangeTrackingV2.zip?accesskey=480EE467CF8E75A090468BF8DF8CB21DC2EF19EC&expires=635537024668437583
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.ExceptionWrapper.Throw()
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit()
at Telerik.OpenAccess.OpenAccessContextBase.SaveChanges()
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.