10 Replies Latest reply on Mar 31, 2015 1:21 AM by rrrichie

    What happens when an external data source opens?

    johnnyb

      What happens when one file opens another file as an external data source?

       

      Do script triggers run? When does authentication happen?

       

      It seems like the connection to the remote file is established only once a layout or script tries to use remote data; is that right?

       

      I've heard some discussion on this, but I haven't found a definitive reference.

       

      I'm trying to eliminate some beachballs that seem to correspond to one file accessing data from another file. Everything is on Server 13. I'm wondering if the hangup is on some startup script, or waiting for LDAP, or something else…

        • 1. Re: What happens when an external data source opens?
          gdurniak

          I also have one solution, in one office, with periodic Beachballs, and have yet to find the reason

           

          The OS is busy with something.  What we really need is a Beachball Log

           

          "On Open" can mean many things,  and done many ways,  so not all defined in one place

           

          some here:   http://www.filemaker.com/help/11/fmp/html/create_db.8.4.html

           

          and here:  http://www.filemaker.com/help/html/create_layout.9.48.html

           

          I even had each script write to a log,  but never found the cause

           

          greg

           

          > I'm trying to eliminate some beachballs that seem to correspond to one file accessing data from another file

          • 2. Re: What happens when an external data source opens?
            johnnyb

            Is there documentation on this, or has anyone done any testing to determine whether OnFirstWindowOpen or OnLayoutEnter or these other triggers run when accessing the file as a remote data source?

             

            I'd love not to re-invent the wheel figuring this out.

            • 3. Re: What happens when an external data source opens?
              gdurniak

              Have your scripts write to a Global Log

               

              That's the only way to be sure.  You may be surprised

               

              greg

               

              > to determine whether OnFirstWindowOpen or OnLayoutEnter or these other triggers run

              • 4. Re: What happens when an external data source opens?
                johnnyb

                Bleh.

                 

                This makes me wish FMI would publish some documentation on internals…

                • 5. Re: What happens when an external data source opens?
                  Benjamin Fehr

                  What happens when one file opens another file as an external data source?

                  I'ld like to say: 20 Leprechauns with suitcases run there to carry the datas over to your place


                  Serious: How is network performance? Keep on mind that ping (response time) is very relevant beside streaming performance. I've been told that ping should be <50ms in order to avoid sync problems.

                  Not my core discipline but to my humble knowledge, it's TCP/IP protocol which sends small packages one after the other and the higher the delay, the more sync problems with data flow occur.

                  Maybe somebody better improved in computer network can give some basics about minimal requirements regarding performance and response time, though you don't have to stare at that beachball constantly.


                  Needless to say that cable connections work better than WLAN, as long as your router doesn't run the new A/C radio standard.


                  • 6. Re: What happens when an external data source opens?
                    jormond

                    Have you reached out to FMI and see about talking to your region's SE?

                    • 7. Re: What happens when an external data source opens?
                      electon

                      File Scripts do not execute. OnFirstWindowOpen etc...

                      Layout triggers do execute if external layouts are opened from current solution.

                      EDS is sometimes a bit lagging behind but not much. Value lists from EDS files, maybe?

                      If the performance is significantly lower compared to LAN it either is the poor up / down speed or the solution slows things down.

                      I'd try and measure the bandwidth with Wire-Shark. You could also give FM Bench a try to find the bottleneck. http://fmbench.com

                       

                      Edit: The ESD files do not always get opened right away. Only when the current file references it at a particular moment, either via a field on a layout, a calculation, or a value list based on EDS TO... You can see which files were opened already via Window > Show Window.

                      The authentication happens, it would seem, when the ESD needs to open and the current credentials are passed to that file.

                      If they are authenticated via Active or Open Directory, there may be a lag there as well.

                       

                      All this is just from testing stuff out, so anybody may have different experiences.

                      • 8. Re: What happens when an external data source opens?
                        Mike_Mitchell

                        electon's description matches my experience as well. External files are opened when they're needed, at which point authentication happens.

                         

                        Triggers fire when the event that triggers them occurs. OnFirstWindowOpen fires when the first window opens, OnLayoutLoad when the layout loads, etc. External files that are open hidden don't have windows, so they don't fire these triggers until they open one.

                         

                        When exactly a file opens has changed over the years. It used to be the case that all files referenced on the Relationships Graph were opened when a file opened, but that doesn't seem to be the case any more. I have one system, for example, with two external data files. One opens when the solution opens; the other opens when the solution navigates to a layout containing a referenced field.

                         

                        YMMV

                         

                        MIke

                        • 9. Re: What happens when an external data source opens?
                          Fred(CH)

                          Mike_Mitchell a écrit:

                           

                          […]Triggers fire when the event that triggers them occurs. OnFirstWindowOpen fires when the first window opens, OnLayoutLoad when the layout loads, etc. External files that are open hidden don't have windows, so they don't fire these triggers until they open one.[…]

                           

                          Exactly, but i have found an interesting and dangerous exception : If your are executing a external script during the file is in a "virtual window" that mean window's name between brackets, and you didn't invoke prior Open File step, the script is executing silently without firing the OnFirstWindowOpen. OK, understood.

                           

                          However, the OnFirstWindowOpen script will not be fired anymore, even you are opening the file manually or via Open file step. Thus, your startup script has never been executed with obviously unexpectable results during all the file use (globals not effected, etc.).

                           

                          If you are interested about this strange behavior click here.


                          Additionnally, please note that Server side script ARE firing the OnFirstWindowOpen. So when creating your startup script, you should think accordingly. You can for instance test "ApplicationVersion" to have a special startup with only compatible steps or avoid it.

                          • 10. Re: What happens when an external data source opens?
                            rrrichie

                            Yes there is documentation.  It's in the "speed" documents.  In there it explains when tables are opened and which rows are fetched.  And specifically what you can do to avoid "triggering" opening or loading too much at once.

                             

                            It all depends how your relationship graph is set up.  Try to make "groups".  Beachballs occur when unstored calcs are used or you have sorted relationships. (ok, slightly oversimplifying here... )

                             

                            Here the document : Design: Performance

                             

                            Add logging options to your solution then you can time these things in your own case.

                             

                            Also if you open the file using the script debugger you can exactly sees what fires and what doesn't.  Most trigger scripts in my solutions (and others I have seen as well ) have a $$skipScriptTrigger or the like to skip the trigger when not wanted.

                             

                            Enjoy optimizing :-)