Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Multi-User Application

Posted on 2004-11-07
3
Medium Priority
?
253 Views
Last Modified: 2011-04-14
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?
0
Comment
Question by:EXwithRaj
  • 2
2 Comments
 
LVL 11

Accepted Solution

by:
rdrunner earned 375 total points
ID: 12521414
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
 
LVL 11

Expert Comment

by:rdrunner
ID: 12521435
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Progress

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question