Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Connection handle Best practice
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00890192
Message ID:
00890202
Views:
21
This message has been marked as the solution to the initial question of the thread.
>I'm currently upsizing a FoxPro app to SQL server. I created a Datatier that connect to SQL server. I was wondering, should I use a SQL connection handle for every instance of my Datatier or should it be better to have a Global SQL connection handle that I would reuse?

You generally want to limit connections to the server. An application-wide connection handle is common. As well as consuming fewer resources on the server, SQL server transactions are by default connection-specific. So, opening each cursor with a seperate handle will prevent saves to multiple cursors from being in the same transaction. I think you generally want to use the same handle for everything unless there's a specific reason to use a seperate one (doing something outside of a transactions, need one for asynchronise processing, etc.)

If you don't specify a connection handle in your USE, VFP will use one handle/DBC.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform