Saturday, February 25, 2012

Application On Start And Database connection

Hello,
I was wondering if someone could help me answer this question.

If I had a site like Yahoo, that constantly had users accessing it. Would it be a good or bad idea to automatically open a database connection to SQL Server on Application Start? What would you recommend? Would opening and closing the DB connection on every page save alot of overhead and bottleneck? Thank You.> Would it be a good or bad idea to automatically open a database connection to SQL Server on Application Start?

BAD idea. horrible in fact.

open a database connection immediately before you need it and close it immediately after.

remember, connection pooling is handled for you.. so it's hardly a huge overhead.|||Thank You for your help.

No comments:

Post a Comment