Can I keep a connection open while the session exists?
-
I'm developing a shopping cart using vb6. (ActiveX dll) For db connectivity I'm using ADO 2.7 The database (free tables) in use for now will be FOXPRO (I know not the best choice) At some point the databases will be converted to MSSQL. My question is: When the cCustomer class is created, can I open the connection to the database and closed it when class is destroyed (on session end)? Or Should I open and close connection as needed? It just seem better to just do it ones, but I'm not sure on how much extra load it will be on the server. There might be up to 500 people on the server at any given time... Please let me know what you think Thank you Iluha :)
-
I'm developing a shopping cart using vb6. (ActiveX dll) For db connectivity I'm using ADO 2.7 The database (free tables) in use for now will be FOXPRO (I know not the best choice) At some point the databases will be converted to MSSQL. My question is: When the cCustomer class is created, can I open the connection to the database and closed it when class is destroyed (on session end)? Or Should I open and close connection as needed? It just seem better to just do it ones, but I'm not sure on how much extra load it will be on the server. There might be up to 500 people on the server at any given time... Please let me know what you think Thank you Iluha :)
To do this project personally. I would use a MS access DB (crap but suited) Create your pages and then store the products buy within an Array which begins size one and then dynamically grows as you insert more items to the basket. To dynamically increase the size of the array while maintaing the content of the array use "Redim" Also when the person moves page to page store the array within a session :) Atul
-
I'm developing a shopping cart using vb6. (ActiveX dll) For db connectivity I'm using ADO 2.7 The database (free tables) in use for now will be FOXPRO (I know not the best choice) At some point the databases will be converted to MSSQL. My question is: When the cCustomer class is created, can I open the connection to the database and closed it when class is destroyed (on session end)? Or Should I open and close connection as needed? It just seem better to just do it ones, but I'm not sure on how much extra load it will be on the server. There might be up to 500 people on the server at any given time... Please let me know what you think Thank you Iluha :)
Holding a connection open to a database as you're thinking doesn't scale well. Use a combination of "just in time" connections, caching (ASP.NET caching is pretty nifty,) and a session shopping cart using an ArrayList of order items should do the trick.
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me -
Holding a connection open to a database as you're thinking doesn't scale well. Use a combination of "just in time" connections, caching (ASP.NET caching is pretty nifty,) and a session shopping cart using an ArrayList of order items should do the trick.
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - meI had a DBA once who stored the UserId created by MSSQL in a table. After a while, usually after lunch, strange effects occured. People started to see other peoples data. After a while we figured out that when the connection is dormant for a while the connection drops and a new one is created when needed. MSSQL does this all by itself. So i dont think you can get a connection all to yourself, you share it with others. Perhaps there is a way to keep the connection alive but why would you want this. HTH, Grtz, Guus