8 Replies Latest reply on Apr 21, 2009 9:42 AM by melastudio

    Filemaker Server 10 scripts never ending

    melastudio

      Title

      Filemaker Server 10 scripts never ending

      Your post

      I have a problem with FileMaker Pro 10 Server.

       

      I tell FMS10 to run a script that execute a FileMaker Script  at a certain time.

      It starts but it never ends... All the operation in it have done but the script doesn't exit; when it starts again (or when another script has called) they run toghether making FMS work slowly....

       

      Can you help me? 

        • 1. Re: Filemaker Server 10 scripts never ending
          philmodjunk
            

          Do you see any error messages in the log viewer?

          Perhaps you can list the script or at least describe it in general terms?

          Will the script run correctly when you perform it from the client?

          Do you have a file option set to run a script when the file opens? (your server side script will trigger "on open" and "on close" scripts.)

           

          I've found that server side executed filemaker scripts have many unfortunate limitations.

           

          • 2. Re: Filemaker Server 10 scripts never ending
            melastudio
              

            No error in the log

             

            The script is the same that worked correctly on FMS9

            This script performs finds and replaces

             

            From the client the script performs correctly

             

            There is a script that start when the database opens... 

            • 3. Re: Filemaker Server 10 scripts never ending
              philmodjunk
                

              There is a script that start when the database opens... 

              Is there any chance that "on open" script will keep your scheduled script from correctly performing? If so there's a way to script around it.

               

              This script performs finds and replaces...

              I'm probably stating the obvious here, but replace operations can be dangerous on hosted files.

               

              Is this script scheduled to run at a time when there are no other users accessing the database? I'm speculating on what would happen if this script ran on the server side and at least one other user had locked one of the records that was the target of the Replace operation. On the client side, you'd see a dialog box telling you that "x records couldn't be modified..." or some such message. TSGal or another FM tech would know for sure, but I wonder what would happen if that dialog box tried to popup during execution of a server side script...

              • 4. Re: Filemaker Server 10 scripts never ending
                melastudio
                  

                PhilModJunk wrote:

                There is a script that start when the database opens... 

                Is there any chance that "on open" script will keep your scheduled script from correctly performing? If so there's a way to script around it.

                 

                I can't see a relation with this 2 events.... 

                 

                This script performs finds and replaces...

                I'm probably stating the obvious here, but replace operations can be dangerous on hosted files.

                 

                Is this script scheduled to run at a time when there are no other users accessing the database? I'm speculating on what would happen if this script ran on the server side and at least one other user had locked one of the records that was the target of the Replace operation. On the client side, you'd see a dialog box telling you that "x records couldn't be modified..." or some such message. TSGal or another FM tech would know for sure, but I wonder what would happen if that dialog box tried to popup during execution of a server side script...

                There is the set error active so every error message is ignored.
                They are control script that run by nigh but I tested in the day and when I see this problem I diactivated...
                I have an equal problem  trying ti perform a script that export some record in a SQL database via ODBC (Driver Actual Technology on MacOSX 10.5.6): but this situation is more complex so I try to solve before the simple problem...
                Many thanks for you interest! 

                 

                • 5. Re: Filemaker Server 10 scripts never ending
                  TSGal

                  melastudio:

                   

                  Thank you for your post.

                   

                  When you set a schedule to run a FileMaker script, FileMaker becomes a client.  Therefore, the file is newly opened and any "On open" script is executed first.  Then, the script you are calling is executed.  Therefore, both scripts could be running at the same time, depending on the complexity of your scripts.  If both scripts are performing finds and replaces across a large set of records, you could witness a major slowdown.

                   

                  If you do have an On Open script, how long does it generally run?  For simplicity sake, let's say it takes no more than 5 minutes (300 seconds).  Therefore, you may want to consider adding to the beginning of the FileMaker script being called:

                   

                  Pause/Resume Script [ Duration (seconds) : 300 ] 

                   

                  This will allow the "On Open" script to finish before continuing on with your script.

                   

                  You may also want to consider using the event log to see what errors are being generated.  This may help determine some possible causes to the non-completing script. 

                   

                  TSGal

                  FileMaker, Inc.

                  • 6. Re: Filemaker Server 10 scripts never ending
                    melastudio
                      

                    When you set a schedule to run a FileMaker script, FileMaker becomes a client.  Therefore, the file is newly opened and any "On open" script is executed first.  Then, the script you are calling is executed.  Therefore, both scripts could be running at the same time, depending on the complexity of your scripts. If both scripts are performing finds and replaces across a large set of records, you could witness a major slowdown.

                     

                    The "on open" script may have some server-incompatible script step! I didn't know that the server become every time a client; Otherwise you have to indicate a login and a pass in order to launch a script so it was prevedible...

                    I've made a user specifically for execute script from the server so I know, in case of problem, if the record has been modified by user or by server.

                    So the on open and on close script could execute or not considering the user (with a simple if).

                     

                    I hope solving!

                    Thank you very much 

                     

                    • 7. Re: Filemaker Server 10 scripts never ending
                      philmodjunk
                        

                      I've discovered a simple way to keep "on open" scripts from executing:

                       

                      If [Get(username) = "ScheduleName"]

                        Exit Script[]

                      End If

                       

                      Just put that at the beginning of any "on open" or "on close" script you have in the file. (and make sure that your schedule's name doesn't match the name of any user name :smileywink: )

                       

                       

                      However, I'm not sure that this is the issue in this thread. If there were incompatible script steps in an "on open" file causing the problem, we'd see error messages in the log. Finding such error messages is how I figured this out in the first place.

                      • 8. Re: Filemaker Server 10 scripts never ending
                        melastudio
                          

                        If [Get(username) = "ScheduleName"]

                          Exit Script[]

                        End If

                         

                         

                        I've done just now.

                        I'll soon reactivate the scripts and I'll keep you informed...

                        :-)

                         

                        Many thanks