Concurrency exception after time zone changed

Thread is closed for posting
3 posts, 0 answers
  1. Jacek
    Jacek avatar
    6 posts
    Member since:
    Dec 2012

    Posted 27 Oct 2015 Link to this post


    I am developer from Poland and I have problem with concurrency control after time zone changed. In Poland we always changed time on winter time zone in 25 October. After that, when I try edit records edited before time zone change I get optimistic verification exception.
    In configuration I have concurrency mode set to changed. When I set it to None, everything works fine but it can't be set in production app. I think it is error in Data Access, how I can resolve this problem? Is it fixed in the next version of Data Access?


    ​Data Access version: 2014.2.711.1
    Database: PostgreSQL 9.3



    {"Row not found: GenericOID@6578b56 Faktury_kosztowe id=673\nUPDATE \"faktury_kosztowe\" SET \"eksport_bank\" = ? WHERE \"id\" = ? AND \"eksport_bank\" = ?\n(set event logging to all to see parameter values)"}

       w Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       w OpenAccessRuntime.ExceptionWrapper.Throw()
       w OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
       w OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
       w OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit()
       w OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.commit()
       w OpenAccessRuntime.EnlistableObjectScope.CommitChanges()
       w Telerik.OpenAccess.OpenAccessContextBase.SaveChanges(ConcurrencyConflictsProcessingMode failureMode)
       w Telerik.OpenAccess.OpenAccessContextBase.SaveChanges()
       w Drukarnia.Web.DrukarniaDomainService.eksportDoBanku(Int32[] ids_faktury_kosztowe, String typ, Boolean grupuj, Int32 rejestr_id) w c:\REPOZYTORIUM\zrodla\Drukarnia\Drukarnia.Web\DrukarniaDomainService_ksiegowosc.cs:wiersz 1768
       w eksportDoBanku(DomainService , Object[] )
       w System.ServiceModel.DomainServices.Server.ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry.Invoke(DomainService domainService, Object[] parameters)
       w System.ServiceModel.DomainServices.Server.DomainService.Invoke(InvokeDescription invokeDescription, IEnumerable`1& validationErrors)

  2. Jacek
    Jacek avatar
    6 posts
    Member since:
    Dec 2012

    Posted 27 Oct 2015 in reply to Jacek Link to this post

    I forgot to add, this happens when I try edit DataTime field with sql type: timestamptz
  3. Boyan
    Boyan avatar
    100 posts

    Posted 29 Oct 2015 Link to this post

    Hi Jacek,

    Generally speaking, when an entity is updated through Telerik Data Access (when using DateTime for concurrency checks), the generated update query would specify a filter based on the primary key of the object that is to be updated and the value of the concurrency column at the time when the object was retrieved from the database to assure no updates are to be overridden accidentally. 
    Therefore I would expect that such optimistic verification exception could be triggered by the following chain of events:
    1. An entity was retrieved from the database.
    2. Time was automatically changed on the database server.
    3. An update for the previously retrieved entity was committed.
    If this has happened then the version column check may fail and cause the described issue leading temporary disturbance. All further queries though should continue to work as expected.

    Is that the case on your side? Please correct me if I am wrong.

    If this is indeed the case, then you could react on that situation by re-retrieving the entity from the database and then retrying the update operation. There is a documentation article that describes in further details how to manage such situations using Telerik Data Access - please find it here.

    I hope this is helpful. Do not hesitate to get back to us if you more questions or need any further assistance.

    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top