database operation in pages
-
hi all i have got a doubt now i have 5 webpages every page has got database operation.. now while using database which way is cheap work to the server 1) opening connection and closing it when ever page requires a database connection or 2)keep it open the database connection and close it when application is getting closed
-
hi all i have got a doubt now i have 5 webpages every page has got database operation.. now while using database which way is cheap work to the server 1) opening connection and closing it when ever page requires a database connection or 2)keep it open the database connection and close it when application is getting closed
kalyan_2416 wrote:
now i have 5 webpages
you might want to try the Asp.Net forum for your web based questions Also, the information regarding the architecture you have is insufficient. Can you enter each page independently of the others? or are they in some sort of order? in either case, its usually better off to abstract your database operations& and therefore connection) to a separate layer.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook "There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
-
hi all i have got a doubt now i have 5 webpages every page has got database operation.. now while using database which way is cheap work to the server 1) opening connection and closing it when ever page requires a database connection or 2)keep it open the database connection and close it when application is getting closed
As long as you have database connections in the pool and you close/dispose of the connections, and you use the same connection string to connect to the database, then option 1 is going to be the better solution. Option 2 means that you have to leave a connection open - which is bad news if the server wants to recycle the database process, or the connection disappears for some reason and you attempt to do a database operation with a connection that is no longer valid. Never design a system that keeps a resource open any longer than it necessarily has to - it just doesn't scale well.
Deja View - the feeling that you've seen this post before.