Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Connection handle Best practice
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00890192
Message ID:
00890202
Vues:
20
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform