Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection string at startup or on request
Message
De
01/04/2003 12:47:37
 
 
À
01/04/2003 12:20:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00772285
Message ID:
00772532
Vues:
9
>>If I create it at first and use the same handle all the time, I guess this will be somewhat faster. Is that right?
>
>In most cases. Since the connection is already open, you won't absorb the time that it takes to open a new conneciton. Now, ODBC, OLEDB, and the .NET managed provider all support connection pooling. In which case, when you went to connect, if there was already a connection in the pool, it would be returned to you. If there wasn't one available, a new connection would be created.
>
>>Also, if that is the case, that means, we will have to issue a handle per connection string that we will use in the application. By that I mean that we can have several connection strings to access various databases with various passwords. So, I'd have to implement an approach that will allow me to setup various connection strings for the ones I need.
>
>That is correct. If you're working with multiple data sources, you would need one for each source/credentials that you wanted to connect to.
>
>>But, this also brings a new consideration. If something happens on the backend, such as a restart of the SQL Server, this would mean that I'd lost those handles. I'll then have to verify or handle that to reset if the situation even happens. Issuing a connection string when require will avoid that as it won't be a factor.
>
>Very true. You'll have to test the connection before trying to use it. You could wrap the connection handle with a function that does this for you and reconnects if the handle is deemed invalid.

Ok, thanks a lot for all the info
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform