Background: I have a VFP Point of Sale system in a multi-location store system. Each store’s software runs independently from the others. We gather and re-distribute relevant information on a nightly basis. I have written a system to store the generated invoices and inventory changes in a cloud-server MySQL database in real time. Each location can retrieve invoice and inventory information for the other locations from the MySQL database on demand. This system allows quicker access to this information than the overnight process does.
This is my first integration using MySQL with VFP. Everything is working great but I have a couple of questions ….
- What are best practices for when to make the connection to the MySQL database from VFP… I currently open the connection at the start of the POS system and disconnect when the POS system is closed. So the connection is always available for the on-demand requests.
- This does cause a problem … It seems that the connection is lost about every 10 minutes when there is no activity. I handle this by testing the connection and re-connecting when I lose it. Is there a timeout setting that I can set either in the ODBC connection or on the MySQL server that would lengthen this timeout and therefore lessen the need for the test/reconnect process?
Thanks for your help!
This is my first integration using MySQL with VFP. Everything is working great but I have a couple of questions ….
- What are best practices for when to make the connection to the MySQL database from VFP… I currently open the connection at the start of the POS system and disconnect when the POS system is closed. So the connection is always available for the on-demand requests.
- This does cause a problem … It seems that the connection is lost about every 10 minutes when there is no activity. I handle this by testing the connection and re-connecting when I lose it. Is there a timeout setting that I can set either in the ODBC connection or on the MySQL server that would lengthen this timeout and therefore lessen the need for the test/reconnect process?
Thanks for your help!