Click here to Skip to main content
15,910,358 members
Home / Discussions / C#
   

C#

 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger10-Aug-09 7:20
softwarejaeger10-Aug-09 7:20 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 7:50
N a v a n e e t h10-Aug-09 7:50 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 8:20
mvePIEBALDconsult10-Aug-09 8:20 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 8:47
N a v a n e e t h10-Aug-09 8:47 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 9:03
mvePIEBALDconsult10-Aug-09 9:03 
GeneralRe: Handling with multiple SQL-DataReader Pin
N a v a n e e t h10-Aug-09 9:14
N a v a n e e t h10-Aug-09 9:14 
GeneralRe: Handling with multiple SQL-DataReader Pin
PIEBALDconsult10-Aug-09 8:09
mvePIEBALDconsult10-Aug-09 8:09 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger10-Aug-09 19:38
softwarejaeger10-Aug-09 19:38 
Well a lot of answers from you thanks =)

So to the question, "why doesn't get every thread a db-connection?", the answer is, that i make a server-application and for each user-connection i have on thread, but i don't have a huge amount of requests from each user, so it doesn't make sense to give each user a own db-connection, and the second is i don't know how many users will use the server.

So the idea with this RequestManager. I make maybe 5 or 10 (or how many i need) instances from it, stored in a List<requestmanager>. Each RequestManager has an own DB-Connection and handles the Reader for itself. If a user now makes a request, the class of the User-Connection starts the Method "GetData()" (give the baby a name Wink | ;) ) from one of this RequestManagers. So i can make a few requests parallel and if i need more i can easily put even more RequestManager in this List<>.

How does my application get the information to put more RequestManager-instances into this list? Well that's easy, over a configuration-file. I let my application reload them every 5 minutes and it checks how many RequestManager i need and so i'm able to configure them while my system is running.

Your examples, had the nearly the same idea as mine. But i only handle with the "RequestManager" and not with Reader and Connections seperately. I can only make failures on one place (the RequestManager).

Thanks for your help, you gave me a lot of inspiration for this problem. Thumbs Up | :thumbsup:
AnswerRe: Handling with multiple SQL-DataReader Pin
senguptaamlan10-Aug-09 22:54
senguptaamlan10-Aug-09 22:54 
GeneralRe: Handling with multiple SQL-DataReader Pin
softwarejaeger11-Aug-09 2:19
softwarejaeger11-Aug-09 2:19 
QuestionGeneric question Pin
Peter Todd10-Aug-09 5:50
Peter Todd10-Aug-09 5:50 
AnswerRe: Generic question Pin
J4amieC10-Aug-09 6:03
J4amieC10-Aug-09 6:03 
GeneralRe: Generic question Pin
Luc Pattyn10-Aug-09 6:14
sitebuilderLuc Pattyn10-Aug-09 6:14 
GeneralRe: Generic question Pin
J4amieC10-Aug-09 6:59
J4amieC10-Aug-09 6:59 
AnswerRe: Generic question Pin
Luc Pattyn10-Aug-09 6:03
sitebuilderLuc Pattyn10-Aug-09 6:03 
AnswerRe: Generic question Pin
PIEBALDconsult10-Aug-09 6:17
mvePIEBALDconsult10-Aug-09 6:17 
GeneralRe: Generic question Pin
Luc Pattyn10-Aug-09 6:22
sitebuilderLuc Pattyn10-Aug-09 6:22 
GeneralRe: Generic question [modified] Pin
PIEBALDconsult10-Aug-09 9:35
mvePIEBALDconsult10-Aug-09 9:35 
AnswerRe: Generic question Pin
DaveyM6910-Aug-09 7:00
professionalDaveyM6910-Aug-09 7:00 
GeneralRe: Generic question Pin
PIEBALDconsult10-Aug-09 12:59
mvePIEBALDconsult10-Aug-09 12:59 
GeneralRe: Generic question Pin
DaveyM6910-Aug-09 21:25
professionalDaveyM6910-Aug-09 21:25 
GeneralRe: Generic question Pin
PIEBALDconsult10-Aug-09 22:02
mvePIEBALDconsult10-Aug-09 22:02 
QuestionLock(This) Pin
jpk42010-Aug-09 5:06
jpk42010-Aug-09 5:06 
AnswerRe: Lock(This) Pin
Ennis Ray Lynch, Jr.10-Aug-09 5:30
Ennis Ray Lynch, Jr.10-Aug-09 5:30 
GeneralRe: Lock(This) Pin
Luc Pattyn10-Aug-09 5:52
sitebuilderLuc Pattyn10-Aug-09 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.