How long the life of a database connection ID?
Posted: Sun Apr 13, 2014 11:04 am
Hi,
I have been reading material about using databases with Livecode and wonder what the best practice is with regards to the database connection ID. My final application will be running on a number of client computers all connected to the same local network. The application will read and write to a postgeSQL database located on the server that is running the LAN.
My internet reading has revealed two schools of thought or so I believe. The first creates/opens a database connection and uses it for the whole period the application is running i.e. many hours. The connection is only dropped when the application is quit. The second creates a connection for a specific use e.g. CREATE table and once the task is complete the connection is closed, obviously this is more complex but does it offer any advantages? Also does it effect how database cursors may be used?
Simon K
I have been reading material about using databases with Livecode and wonder what the best practice is with regards to the database connection ID. My final application will be running on a number of client computers all connected to the same local network. The application will read and write to a postgeSQL database located on the server that is running the LAN.
My internet reading has revealed two schools of thought or so I believe. The first creates/opens a database connection and uses it for the whole period the application is running i.e. many hours. The connection is only dropped when the application is quit. The second creates a connection for a specific use e.g. CREATE table and once the task is complete the connection is closed, obviously this is more complex but does it offer any advantages? Also does it effect how database cursors may be used?
Simon K