Multi-User Application

What're the basic settings & features you need to've in a VB application designed for a multi-user environment.For ex:
a) CursorLocation setting?
b) CursorType setting?
c) LockType setting?
d) Handling "conflicting data"?
e) Any backend-specific differences & considerations?
e) Anything else?
EXwithRajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rdrunnerCommented:
Hello,

If you write such an application you need to make sure that there are no Concurrency conflicts. Depending on how many users are using your application you need to decide which locks you use.

There are essentially three options for handling these scenarios (with some variations). In the first option, we do nothing, allowing the changes of the last user to overwrite the changes of the first without warning. This is typically known as the "last in wins" scenario.

The second option is to take the optimistic approach. In this scenario, you predict that it is unlikely or rare that two users will try to edit the same record at the same time; therefore, you place a check in your Update or Delete statement to make sure the underlying record has remained unchanged while the edit has been in progress. If it has changed, the edit fails and the second user will need to start the process over.

In the third option, you take a pessimistic stand. In this scenario, you predict that it is likely that two users will be vying for the same record so you place a lock on the record when the first person accesses it to prevent any others from accessing it until the first edit is complete. In a connected world, this could be handled by record locking in the database itself. Otherwise, you would need to provide your own system to track locking.

To achieve this you "just" use the cursors with the appropiate name.

But this also means you need to keep the connection to the DB "open" all the time. If you have "many" users then this might not be such a good idear.. If you want to close the connection you need to implement your own locking mechanism. For example a field in your DB where you enter the Userid of the user currently editing the record. (i would suggest this)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rdrunnerCommented:
edit i mean you "just" use the LOCKING modes...

Optimistic,Pessimistic and None....

The cursor only tells your application where the data will be held... If you want to scroll trough a huge table you need to use a server side cursor, since it will only transmit the needed records to your application. (But will cost "extra" performance on your server if you plan to read all rows anyway) If you use a client side cursor then all data will be transfered to your application at once and you will handle the data in your application...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.