5 Replies Latest reply on Jun 7, 2017 11:06 PM by marcj

    how do you close filemaker connections using API


      Ok I have a simple question. I want to log out and close my connection to the filemaker database ( don' want to leave it open)

      I have version 12 server. I connect just fine with a login page and bring up the database.

      Seems simple but I can't find any method in the API. It seems all too simple but I can't find any reference of this.




        • 1. Re: how do you close filemaker connections using API

          Hi John,


          I asusme you're talking about the PHP API here?


          There's no need to logout via the PHP API as it's a stateless connection - you connect/authenticate to the database, create/edit/view etc the record/s and then you're done and the connection is closed when the PHP script finishes.





          FileMaker 12/11/10/9/8 Certified Developer


          - - - - - - - - - - - - - - - - -

          Phone: +61 2 9484 6565

          Mobile: +61 418 468 103

          Email: andrew@databuzz.com.au


          • 2. Re: how do you close filemaker connections using API

            databuzz...  im using fms13


            In my case, its not closing.. we are three people are fetching server, but i can see that 16 or 20 connections avaible right now by using fmphp..


            I think we should this connection after  php request will be complete.. what you say ?

            • 3. Re: how do you close filemaker connections using API

              To optimize performance, FileMaker leaves connections open for a time (a few minutes; don't know the exact value) in case the same client makes another request shortly after the first. This avoids the overhead of making new connections one right after another. If the client doesn't make a new request within the timeout period, the connection is automatically closed. This change was made in version 12 of Server. You don't have any control over it, nor is there any need.





              • 4. Re: how do you close filemaker connections using API

                Thanks for the clarification Mike.


                You mention that we have no control over the timeout period nor is there a need, but wouldn't you want some type of connection management at your disposal considering you have a limited (albeit theoretical) number of connections?


                I understand a server will need to see a lot of traffic before that becomes an issue, but just playing devil's advocate here. Other database API's (mysqli, PDO) have options to terminate database connections manually (and automatically after script execution in some cases) with PHP. Feels like FileMaker decided to arbitrarily choose for the developer how performance will be managed when it comes to connections.



                • 5. Re: how do you close filemaker connections using API

                  Was this ever addressed? This seems to be a significant problem when it comes to performance. Does anyone know how long the timeout period is or how to decrease it?