9 Replies Latest reply on Jul 12, 2016 4:53 PM by milton.kirkwood@gmail.com

    Record Locking

    milton.kirkwood@gmail.com

      Hi,

       

      I have a Filemaker 15 application running on a web server as a shared application. When a user tries to access a record which is already open and being modified by another user they receive a warning message that the other user (name given) is already modifying that record and offers the choices of sending the other user a message or clicking OK. This is normal behaviour that I would expect.

       

      However, irrespective of the choice taken (sending a message of clicking OK) the user cannot exit the process until the other user exits the locked record and hence they are effectively blocked from doing anything unless they force quit the application.

       

      Has anyone else faced this problem and, if so, is there a solution?

       

      Thanks in advance,

       

      Milton

        • 1. Re: Record Locking
          jormond

          1. For better exposure. I would place questions about FM in the "Discussions" space. "Community Feedback" is more for issues related to this website and the Jive software that runs it.

           

          2. Revert record will take the record back to the beginning state, and allow the user to move off of that record.

          • 2. Re: Record Locking
            TSPigeon

            milton.kirkwood@gmail.com:

             

            Thank you for your post!

             

            As jormond suggested, I am going to move this thread from the FileMaker Community Feedback Space, which is specifically for input on the Community itself, to the Discussions Space where you should receive more views and potentially more advice!

             

            TSPigeon

            FileMaker, Inc.

            • 3. Re: Record Locking
              milton.kirkwood@gmail.com

              Hi Joshua - thanks for your comments and your answer. Unfortunately when the error message appears about the record being locked the user cannot access the menu to revert the record so they are stuck until the other user exits the record or until they force quit the application.

               

              Milton

              • 4. Re: Record Locking
                Mike_Mitchell

                Is the user attempting to access the record via some scripted process? Are there any Script Triggers associated with either the layout, the record, or the particular object being accessed?

                • 5. Re: Record Locking
                  milton.kirkwood@gmail.com

                  Hi Mike,

                   

                  Thanks for your question.

                   

                  The answer is yes, the record is accessed via a scripted process. I have a primary table named CLIENT and another table named PROJECTS which has a relationship to CLIENT via a clientID field in both tables. The linked PROJECT records are shown on the CLIENT screen via a portal and the user accesses the appropriate PROJECT record by selecting a line in the portal. This triggers a script which does a number of things, such as writing an audit record in an AUDIT table but it also calculates some financial totals in the PROJECT screen.

                   

                  Hope this helps you understand what is happening.

                   

                  Thanks,

                   

                  Milton

                  • 6. Re: Record Locking
                    Mike_Mitchell

                    I suspect this is the source of the issue. It sounds like the script needs to check for record lock (error code 301) and take appropriate action if such is received.

                    • 7. Re: Record Locking
                      milton.kirkwood@gmail.com

                      Thanks Mike - I will check it tomorrow and post accordingly. It is now

                      Tuesday evening (8.00pm) in Sydney Australia.

                       

                      Milton

                      • 8. Re: Record Locking
                        fmpdude

                        To avoid issues like these....Is there a reason why there aren't "optimistic" record and even table locking schemes in FMP?

                         

                        Visual FoxPro, for example, had 5 so-called buffering modes:

                         

                        1. None.

                        2. Pessimistic row (what FMP does)

                        3. Pessimistic Table

                        4. Optimistic Row

                        5. Optimistic Table

                         

                        There were built in VFP functions to work with the various buffering modes as well, naturally.

                        • 9. Re: Record Locking
                          milton.kirkwood@gmail.com

                          Hi Mike,

                           

                          You were absolutely correct and I have been able to overcome the issue by inserting the following into my script

                           

                          Set Error Capture On

                          Set variable [$Error ; Value: Get(Last Error)]

                          Go to Next Field

                          If [ $Error = 301 ]

                          Show Custom Dialog [ "W A R N I N G" ; "Record locked by another user - please try again shortly." ]

                          Exit Script

                          End If

                           

                          This allows the second user to proceed to the child record and they still receive the standard error locking message if they attempt to modify the record when someone else is already modifying it.

                           

                          Thank you very much for your assistance.

                           

                          Milton