c# - Sharing an Oracle connection across multiple data handlers -


i have solution in updatecontroller class manages logic updating data. controller calls various classes managing data (claimdata, statementdata, etc.). what's best way share connection across these data handlers--use singleton, or create class managing connection , passing each data handler? if application multithreaded?

thanks in advance.

you use dependency injection provide each of these connection...

another way use oracle provider internal connection pooling (for example devart dotconnect, customer)... share connection string via dependency injection or configuration file... every class instantiates/releases connection on own... central connection pooling takes care of rest (reusing connections etc)... way don't have worry threading issues regarding connections...


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -