Link to home
Start Free TrialLog in
Avatar of BobMiner
BobMiner

asked on

DB/VB design opinion request, be quick for the points.

Hi,
This isn't a "how to" question; I know how to do both ways.  THis is a "which is best, and why" question:

I'm using VB client, Network based DB, max simultaneous users 20 viewing mostly different data (not transaction heavy), is it better to:

-Open a bunch of recordsets at client-startup & leave 'em open during session.

_OR_

-Open & close recordsets upon request of client each time DB access is necessary (which might be once evry 30 seconds to once every 10 minutes)

I'm currently using Access, but I'm gonna migrate to SQL Server or Oracle as soon as the LAN Admin guy gets his act together.  ADODB connection.  Sessions might last 3 to 8 hours.

Thanks in advance for sharing your experience & knowledge.

Bob
ASKER CERTIFIED SOLUTION
Avatar of joekendall
joekendall
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GoodJun
GoodJun

For 20 concurrent users, it really doesn't matter. The speed wise is the same (you can't tell the difference).
The second method is better if you want your app be more
scalable. It has the potential to use the new technology to scale to more users.
Load them as you need them.  Your app will start up faster and require fewer resources.

Unless you're executing massive, complex queries, running them as needed shouldn't be a performance problem.  Just be sure that as they are closed, all references are set to nothing.  With ado, I've found it's best to explicitly close the recordset and then set the recordset object to nothing.
I would open disconnected recordsets on the client if you're not planning on having a lot of transactions on them to cut back on server traffic, unless you're on a dedicated server.  If there are other applications hitting that server, and you're connection is going to be open that whole time, and they may be hitting the server pretty hard, it could be more beneficial to have your recordsets open on the client.  That way, if someone else is hitting the server hard and causes it to crash, you still have your data.  

If there aren't any other applications hitting the server, or that aren't transaction heavy as well, then it probably wouldn't make too big of a difference.  
I agree with joe and bob.  Open as you need them.
gencross,
What's the difference between mine and theirs?
GoodJun,

Joe and bob stated upfront that opening rs's as the user needs them is the better solution, not that it doesn't matter which method is used as you commented.  I did not want to state what the others already stated so I just said I agree with them.  

Not that I disagree with your entire comment.  Everything sounds good except..."For 20 concurrent users, it really doesn't matter.  The speed wise is the same (you can't tell the difference)."

There is good software design and bad software design, and in my opinion opening many rs's that may or may not be used is bad software design and poor use of resources.

That is my dissertation on why I agree with joe and bob.  I hope it was informative:)
Avatar of BobMiner

ASKER

I thank you all for the input especially after seeing other comments that beat you to the points.  I'll go with the consensus of "open as needed, then close".

I've asked support to award some points to GoodJun, bob online, and VBGuy91917 for your valueable opinions.

Regards,
Bob
gencross,
>There is good software design and bad software design, and in my opinion opening many rs's that may or may not be used is bad software design and poor use of resources.

There are a lot of times open a bunch of rs at start up is the choice. (say, some library records you need often address, etc...). Design is depends on the situation. We can't say that maintain open rs is bad design. It has its places.
Ok :)
Thanks again to all.
A couple of you guys have points to collect.
Thanks for the input.
Bob