[FX.php List] Approach to replacing a large set of records from one FMP file to another

Jonathan Schwartz jschwartz at exit445.com
Mon Apr 22 11:31:10 MDT 2013


Hi folks,

I currently have a FMP API web publishing system the pulls records from a master FMP db.  Up until now, I have used native scripted FileMaker imports (FMP to FMP) to move records between the dbs.   For a variety of reasons, I would like to use php to perform the imports.  My first attempt at the task was to execute the following steps. In this case, the task is to replace all the web publishing records in the remote system with records from the master (master --> remote). In this case, the data set is 800 records but I have other files which contains 30,000 records.

1) Find all current records in remote via PHP
2) Create a PHP array containing all RecIDs (for later deletion)
3) Perform PHP find on master
4) Execute PHP loop to add records one at a time to remote (remote now contains both old and new records)
5) Loop through RecID array and delete old remote records one at a time, using PHP.

When complete, the remote db would theoretically contain only the new records.

In reality, the process is failing during the Delete loop, producing an HTTP  500 error with message: The FastCGI process exceeded configured activity timeout after about 60 seconds.  Apparently, this is different than the regular PHP max_execution_time, which is already set for 300 seconds. Environment is Windows Server 2008 R2.

My questions:

Is this the right way to deal with mass addition and deletion of records between db's using PHP?  I can already see that failure creates a mess...which is now exposed to production.  Perhaps a different method would ensure transactional integrity.

Does anyone know how to solve this FastCGI error?


Thanks!


Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
www.exit445.com
cell: 415-370-5011

Jonathan Schwartz
jschwartz at exit445.com





More information about the FX.php_List mailing list