• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] Record Locking Equivalent in Stateless Environment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] Record Locking Equivalent in Stateless Environment

    What is the development strategy for implementing record locking for web apps in Valence?

    Here's where I'm seeing a problem. You have a department of users updating...let's say a part file. In a stateful environment (ie. green screen), you can tap into the native record lock features to prevent 2 users updating a part record: you would purposefully lock a record via chain when it has been selected from a subfile. However, in a stateless environment (let's say a user selects a part from a grid of records), how will you know if another user requested that same record for update?

    Off the top of my head, the only way I would know to do this is to use a file (or possibly a data queue) as the locking mechanism. When a web app that updates a file sends a request to view the details of a record, you could create a record in a "record locking" file/dtaq with the record's key information, file name, and user's session id (or token or whatever it's called in Valence). Prior to creating the record, you would check the record locking file/dtaq to see if a record with the same "key/file" information exists. If it does, then the record is locked and no updates are allowed to that record, UNLESS you are the same user. (hopefully that idea makes sense).

    I just wanted to make sure that there wasn't some other way to handle record locking to preserve data integrity over multiple users changing contents in a file.

  • #2
    Ah, a very common problem in the stateless web world!

    The locking file approach is what we typically recommend. In addition to a file/record identifier, it would be a good idea for your locking file to include the unique 6-digit Valence user ID and the 64-character session ID. You should then create a simple exit program to remove any orphaned locks (using the session ID) whenever sessions are killed or time-out. You can specify this exit program in your Settings.

    We're actually considering incorporating this locking functionality as part of the base Valence package in the near future (possibly the first 3.1 maintenance release). Watch for that in April.

    Comment

    Working...
    X