Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to check for and/or create connection to DB
Message
De
08/01/2013 12:30:51
 
 
À
08/01/2013 12:26:45
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01561620
Message ID:
01561740
Vues:
50
>>>>>>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 can always fetch the next question (and not display it yet) after you display the current question. Sort of using the 15-30 seconds time frame.
>>So you have the next question long before the current one gets answered
>>
>>
>>Update - or even better - fetch all the questions in advance in one go, then display them one by one
>
>Can't - it's an adaptive test, I don't know what the next question is until they answer the last one.

Any way to make some educated guesses ? Fetch all the possible next questions - discard the ones you don't need

How many questions are there possible in one test ? Bring them all in


Keep a pool of questions in a dictionary. If it is in, take it from there, if not fetch it
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform