Locking objects with Transaction.Lock ()

2 posts, 0 answers
  1. Anatol
    Anatol avatar
    4 posts
    Member since:
    Jul 2010

    Posted 15 Sep 2010 Link to this post

    Hi to all.
    Telerik.OpenAccess 2010.2.714.1 + Firebird 2.5 RC2
    I'm trying to realize such construction.
    In the database the original objects and user's customization settings for some ones from them are stored. I want load original objects, apply user's setings for it and show customized objects in view for edit. All futher new settings also store in user's settings class (mutliuser application). Each user can insert or delete user's objects (not "standard") and make custom settings ("edit") all objects.
    I make a transaction with PESSIMISTIC_EXPLICIT mode, load original objects and trying to lock with
    ScopeProvider.ObjectScope().Transaction.Lock(MyCollectionOfObjects, LockMode.WRITE);
    after editing this collection in UI there are dirty objects in the scope and after Transaction.Commit() all changes in "locked" original objects are stored in database instead user's settings.
    Maybe, I don't inderstand a purpose of Transaction.Lock () method or use it not correctly?
    Please, help me with my problem. If you know other ways to solve my problem would be happy to see them.
  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 20 Sep 2010 Link to this post

    Hello 1,

     Are the 'User setting' objects locked and modified in the UI? If you want to take care of concurrency issues have you considered the Optimistic Concurrency support by OpenAccess. You can find more about various Concurrency control mechanisms, here.

    All the best,
    Ady
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top