JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1658
|
Re: connection a BD??
Depends on a lot of things (like # of users) but perhaps the "most" important factor is this: how often is the database being used?
For example, if the DB is used only for a few starting values, and a query every so often - the program can do most features without the SQL, then disconnect after running a query.
If, however, the program mainly displays the results from queries, and doesn't really do anything on it's own (ie: no SQL, program's useless) then maintain the connection from first use to last.
Of course you could put an "inactivity disconnect" routine in the program - disconnect after x minutes/seconds.
And it also depends on how many users you can have connected at a time to the SQL server, if it's only 5-10 and you have 50+ users...
Generally, establishing a connection to the server, while only a few seconds (or msec), will increase the program's run time. SQL Servers do disconnect users after long periods (some at least).
|