Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Network Record Lock

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

    Network Record Lock

    I have never had to be concerned with network applications before, however I will be running into the problem where two users could easily be accessing a common record and this is a huge concern.

    This would occur from a zoom to form from a browse on a form. Currently I tried to do this and I was using a full version of Alpha and the other person was using a runtime version and we both were able to zoom to the same record and be capable of editing. Is this because it is a dialog? I was afraid of "locking" the record with a logical field as if something were to happen i.e. the user closes the form without hitting a button that would "unlock" the record by changing the logical field.

    I would appreciate any thoughts or advice by those who have knowledge, thank you.

    #2
    Re: Network Record Lock

    John,
    Would they both be updating that common record at the same time, or just accessing it? We have a couple of hundred users on our system, and there are common tables to many of our applications. We haven't run itno the situation where two people are updating the exact same record at the exact same time. Alpha will perform record locking for update for you.

    Tom

    Comment


      #3
      Re: Network Record Lock

      Typically, 2 people would not work on the same record at the same time. They may use the same form(no problem) without having the same record in edit mode.

      I have users of over 20 at the same time, but they all work on diffferent records, but never the same.


      Rukle of thumb is if the same record can be opened by 2 people and edited, it would only be the second saved edit that would be saved. Memory serves me that it cannot happen, but others may know more.
      Dave Mason
      [email protected]
      Skype is dave.mason46

      Comment


        #4
        Re: Network Record Lock

        Due to the nature of the application, there are very few records per day with multiple changes by multiple users. Alpha lets me open the form and the same record in a dialog form, it seems that whoever the second user who hits save gets his saves applied. I thought that Alpha should lock out another user when the record is attempted to be opened. Is there a way to check for this and I could script it or a way to open the record exclusivly?

        Comment


          #5
          Re: Network Record Lock

          The test is to have both users on the same record and each edit.

          Then press save on user 1, followed by save from user 2.

          Report back with your findings..
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


            #6
            Re: Network Record Lock

            try here:
            http://www.csda1.com/csda_codeutilit...#recordlocking
            Dave Mason
            [email protected]
            Skype is dave.mason46

            Comment


              #7
              Re: Network Record Lock

              The information is fairly general, so I suppose I will have to have some scheme to lock the record. I am opening a dialog form to make the edit, so on that edit button I could set a lock logical and then uncheck it after closing the form. My worry is if it crashes or the form is closed with alt-f4 or something and the record is not unlocked.

              Comment


                #8
                Re: Network Record Lock

                Not sure if this is the best way to do it, but I think you could use the timer event of the form to keep a timestamp fresh during an edit session.
                (because you are worried that someone may not exit the form correctly)

                Pseudo-Code:
                When the button gets clicked, query the contents of the specific record into memory, and check the three following (new) record fields: Locked (L), UserID (C) and TimeStamp (D).....

                But first, allow the form to be opened with field attributes set as read only. Add an "edit button" to the form.

                onPush event, If the record is locked, and the timestamp is recent, keep all the fields read only. (on the form) and display message.... "please wait"
                If not, update the timestamp fields to keep record un-editable by others. (grab the lock)
                If the timestamp is old, update it along with the present users ID and then change field attributes on the form to make form editable. (take possession of a bad lock)
                Have a save button change field "Locked" back to .F. once all the fields are updated in table. (probably use an the onchange event of the table itself for this?)

                ~And of course, when you're in edit mode, the timer event (of the node doing the editing) will have to periodically update the timestamp until such time as the save button is pressed. (maybe ever 10 seconds???) ~ So if another user sees a locked record with a timestamp 20 seconds or more it can release it on behalf of the original "locker" who is no longer there.....

                ~Upon hitting the edit button, one thing that also should be done is to check and make sure you actually get the lock. (as opposed to someone else clicking edit at the exact same time..... (That's where the User ID field comes in).....

                "Looks good in print, anyways....... ~ But I'd ask someone more experienced before you try this......"
                Robert T. ~ "I enjoy manipulating data... just not my data."
                It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                Comment


                  #9
                  Re: Network Record Lock

                  The information is fairly general, so I suppose I will have to have some scheme to lock the record. I am opening a dialog form to make the edit, so on that edit button I could set a lock logical and then uncheck it after closing the form. My worry is if it crashes or the form is closed with alt-f4 or something and the record is not unlocked.
                  This approach is "pessimistic", assuming other users are working wtih the same record more often than not. An "optimistic" approach is better if other users are not working with the same record, more often than not. Dr. Wayne illustrates an "optimistic" solution to the multi-user issue in his book, "Xbasic for Everyone 2008". Basically he captures field values from the record at the beginning of the edit session. He does the edits using an xdialog. When the edits are ready to be saved his script re-checks the field values on disk. If they have changed, someone else updated the record while the present user was editing. So the current edits are discarded and the user is notified. Otherwise, the current edits are saved. The "optimistic" approach minimizes the time the record is locked. i.e. it is not locked throughout the time the user is painfully and slowly entering text from the keyboard.

                  Comment


                    #10
                    Re: Network Record Lock

                    This is the approach I have had to take with one of my apps. which takes updated data from Web'n'Walk and adds it to the clinical database.
                    I have the client records locked when they are "checked out" - which means that they are the responsibility of the person who has indeed checked the client record out.
                    There is a SysAdmin feature to unlock all if the server gets bounced in the middle of a transaction (don't ask!).
                    See our Hybrid Option here;
                    https://hybridapps.example-software.com/


                    Apologies to anyone I haven't managed to upset yet.
                    You are held in a queue and I will get to you soon.

                    Comment


                      #11
                      Re: Network Record Lock

                      I've been using that method successfully to maintain data integrity.
                      Say you lock a master record, for the duration a user is editing.
                      You need to make any operations that could update that record as part of a sequence of record writes, check for any locks before beginning the sequence.
                      Or do batch updating as opposed to real time. That too has drawbacks.
                      Ive been doing indefinite wait during critical sequences, displaying a dialog of the user name responsible. Users find that irritating.
                      I read somewhere that Alpha has a preset wait time, but in practice users can also go for tea with an edit open.


                      A method I am considering putting into operation for the user editing using the CanWriteField event to save TableName->FieldName value (The initial value of the field at start of typingl).
                      And re-read the record before writing the new value back and prompt if changed. I haven't tried that last part yet. But it inconveniences only the user responsible.

                      I really would love tips from the more alpha experienced programmers.

                      Comment

                      Working...
                      X