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

Pessimistic Locking with WCF Data Services

3 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikolai Hellwig
Top achievements
Rank 1
Nikolai Hellwig asked on 07 Apr 2010, 08:43 AM
hi,

we're developing an application which is used in parallel with "Oracle Forms 11g". In order to prevent malfunction, we have to deal with locking. Forms is using "SELECT FOR UPDATE" for locking so we used OA Transactions with EXPLICIT_LOCKING in our application.
Now we are starting to port our business layer to WCF. 
So my questions are: 
Is it possible to do Pessimistic Locking with WCF Services? 
Would you recommend that?
What alternative solutions do you know?

thanks
Nikolai Hellwig
CHW Software GmbH

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 07 Apr 2010, 12:52 PM
Hello Nikolai,

In principle this is possible. The only problem is that in order to perform '... for update', the connection will  be pinned (bound to the object scope), and therefore you will need to find+use the same object scope instance for the same client again. Otherwise another WCF client could get the scope -> pinned connection and would fail then. This applies only, if the client is stateful (doing the locking, going back to the client, returning to terminate the transaction).

One consideration more: It is best practice to lock things only for a short period of time, otherwise the scalability in the server will be affected. How do you manage to keep the lock time down (or is it an atomar call like (find,lock,change,commit)?

I do not know how Oracle Forms can perform concurrency control, but having 'ROWVERSION' field is another way of CC that does not involve explicit lock calls. You will need to consider the amount of work that is done in parallel, on how many different rows and which operations should be blocked if values change.

Best wishes,
Thomas
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.
0
Nikolai Hellwig
Top achievements
Rank 1
answered on 07 Apr 2010, 12:59 PM
thank you very much.
this is what i already thought. we're going to discuss this optimistic locking aproach with rowversions. The Only problem is, that Oracle Forms is blocking rows and if i try to change values (UPDATE ...), the thread is hanging until Forms commits the current Transaction.

Is There a way of calling Native SQL (Select ... For Update) with Table Name and Primary Keys except scope.GetSqlQuery()?
0
Accepted
Thomas
Telerik team
answered on 07 Apr 2010, 06:04 PM
Hello Nikolai,

there is no other way of doing SQL execution, except using stored procedures. 
Maybe you should check if the lock timeout value is set correctly, so that lock do not block forever?

Regards,
Thomas
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
General Discussions
Asked by
Nikolai Hellwig
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Nikolai Hellwig
Top achievements
Rank 1
Share this question
or