New Posts New Posts RSS Feed: Using pessimistic locking in DevForce entities and transaction UIs
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Using pessimistic locking in DevForce entities and transaction UIs

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Using pessimistic locking in DevForce entities and transaction UIs
    Posted: 20-Jun-2007 at 9:39am
I’m not sure if I already asked this topic before, but we are planning to implement pessimistic locking approach on our transaction forms instead of the optimistic locking. Does IdeaBlade has some tips or discussions on using this approach? I only noticed the proper use of the optimistic locking using the ConcurrencyHandler and the RowVersion concurrency column.



Thanks a lot for the help.

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jun-2007 at 9:41am

Michael, 

DevForce does not inherently support pessimistic concurrency, which is why our tutorials address only optimistic concurrency. 

DevForce is designed to support highly-scalable, high-performing applications.  Database connections are opened and closed as needed, but always for short durations.  This means that a single PM.GetEntities call opens a connection, fetches data, and closes the connection.  A single PM.SaveChanges call opens a connection, persists data, and then closes the connection.  This is true whether the application is client-server or uses a Business Object Server.  Since connections are always short-lived, any locks held are also short-lived, and there is no way to issue a lock spanning the boundaries of an individual get or save. 

We always advise that our customers not use pessimistic concurrency, since we believe optimistic concurrency is the better approach and can be used with most, if not all, applications.  For a kind of “checkout” pattern where you want a user to grab something and hold onto it until done, you have several options other than database locks.  One would be to use a flag of some sort on the record itself which could indicate availability/in use.  Another option might be to use an additional table that tracks “checkouts”.  I’m sure there are other options too, but what these have in common is that they do not rely on an open connection and database locks, but instead make the “locking” the responsibility of the application. 

Please let me know if you need any more information.  If so, I can try to give you a more detailed explanation or get you in touch with one of our architectural gurus.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down