Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to check for and/or create connection to DB
Message
From
08/01/2013 11:41:37
 
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01561620
Message ID:
01561734
Views:
69
>>>IMO if you are assuming you will be doing a pile of queries in a short amount of time, leave the handle open.
>>>
>>>If the queries will be spread out over time (waiting for user action, etc) - open and close as needed.
>>
>>In the Signon screen, there's a call to get Student Name and Instructor Name from the Student Control Number and another to check password.
>>
>>In the DispQuestion screen, between each question it
>>
>>1) 'Scores' the answer
>>2) Stores QuestionID, Answer, CorrectAnswer, Time Answered
>>3) Checks to see if the next Question is an Experimental Item, if so, skips #4, selects the next ExpItemID
>>4) Calculates an Information Function on all possible next questions, based on what's needed next and what gives the most information.
>>5) Displays the next question.
>>
>>Would there be any performance hit to create/open for each call...and does a 'Close' clear the connection from memory. IE, I don't want to be creating multiple copies of QConn for each student.
>
>Closing a connection leaves the connection in memory. You can Open it again.
>
>If it is scoped to a SQLCommand or a function/procedure that goes out of scope then the connection goes away with it.
>
>If you are rolling through hundreds or thousands of questions quickly (like - per second), then there will be a performance hit. Still not horribly bad, but there will be one.
>
>You can watch and get metrics on the running code in VS. You might want to watch this to get a good idea of how your particular app is running.

Thanks for the info. As for throughput, we're talking hundreds of questions per second per session. Average time to answer per student is (roughly) 15-30 seconds and as this is a timed test, I want to keep the time between answer and display of next question as short as possible.
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform