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:
00890206
Views:
23
Thanks Dan,

I didn't know that SQL server transactions are by default connection-specific. In my case, this means that I cannot include multiple Datatier with different connection handle in the same Begin -- End transaction block?


>>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.
Luc Nadeau
lnadeau@neova.ca

"the theory, it is when all is known and that nothing works. The practice, it is when all works and that nobody knows why." - Albert Einstein (Nobel of physique 1921)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform