This is a migrated thread and some comments may be shown as answers.

Locking objects with Transaction.Lock ()

1 Answer 68 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anatol
Top achievements
Rank 1
Anatol asked on 15 Sep 2010, 07:26 AM
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.

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 20 Sep 2010, 10:29 AM
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
Tags
Development (API, general questions)
Asked by
Anatol
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or