On 11/8/06, Steve Ellenoff <[EMAIL PROTECTED]> wrote: > I'm curious what everyone's adopted standard is regarding creating > remote connections to access remote databases from VFP. >
Like most situations, you need to strike a balance between competing demands. Different demands take on different magnitudes for each application, so these are the thing you try to balance: 1. Connections consume resources on the server, so they will limit how many connctions can be made, and how far the server can scale. If each connection is 64 kb, ten thousand of them is 640 Mb. 2. Establishing and closing connections consumes precious processing time, on both ends of the connection. While an open- and close-cycle may only take 400 ms and 50 ms respectively, doing a hundred of them in a row to process a hundred rows of data consumes a lot of time. And tracking opening and closing logic to make sure you're not leaking unclosed connections is introducing more bugs. There can't be bugs in code that's not there. 3. You can maintain one "master" connection, as long as you only perform transient (quick and complete) operations on it. There are situations where you'll want to create an asyncronous transaction (launching a time-consuming process, checking back on it later) or a progressive fetch (great for filling grids with large amounts of data without downloading any more than needed), both of which tie up a connection. These connections should be separate and temporary and closed as quickly as possible, both for licensing considerations (if applicable) and for #1 above. As I said: different situations can dictate different choices: servers that host huge numbers of connections might dictate only connecting when needed, processor-bound servers might not want to handle the overhead of connecting and disconnecting. Whichever you decide, bear in mind you'll want to keep you options open, and have some means (like a Connection manager) of centralizing your behavior and tracking and instrumenting what you're doing. -- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

