Page 212 -
P. 212

Q5-4  How Do Database Applications Make Databases More Useful?




                                                       Building 100                Building 150           Building 220   211






                                                                                                              Building
                                                                                                              240


                                         Building 300
                                                                                   Building 400


















                    Figure 5-16
                    Graphical Query: User Clicks on   Security requirements are more stringent for  browser-based Internet applications  than
                    Video Icon to Find All Videos from   for   traditional ones. Most  traditional applications run  within a corporate network  protected
                    That Location
                                               from threats common on the Internet. Browser-based applications that are open to the public, over
                                               the Internet, are far more vulnerable. Thus, protecting security is a major function for browser-
                                               based Internet application programs. Like traditional database application programs, they need to
                                                 provide for data consistency and to handle special conditions as well. As an example of the need for
                                               data consistency, consider the problems introduced by multi-user processing.

                                               Multi-user Processing

                                               Most  traditional and  browser-based applications involve multiple users  processing  the same
                                                 database. While such multi-user processing is common, it does pose unique problems that you,
                                               as a future manager, should know about. To understand the nature of those problems, consider
                                               the following scenario, which could occur on either a traditional or browser-based application.
                                                   At a ticket vendor’s Web site, two customers, Andrea and Jeffrey, are both attempting to buy
                                               tickets to a popular event. Andrea uses her browser to access the site and finds that two tickets are
                                               available. She places both of them in her shopping cart. She doesn’t know it, but when she opened
                                               the order form, she invoked an application program on the vendor’s servers that read a database
                                               to find that two tickets are available. Before she checks out, she takes a moment to verify with her
                                               friend that they still want to go.
                                                   Meanwhile, Jeffrey uses his browser and also finds that two tickets are available because his
                                               browser activates that same application that reads the database and finds (because Andrea has not
                                               yet checked out) that two are available. He places both in his cart and checks out.
                                                   Meanwhile, Andrea and her friend decide to go, so she checks out. Clearly, we have a problem.
                                               Both Andrea and Jeffrey have purchased the same two tickets. One of them is going to be disappointed.
                                                   This problem, known as the lost-update problem, exemplifies one of the special characteris-
                                               tics of multi-user database processing. To prevent this problem, some type of locking must be used
   207   208   209   210   211   212   213   214   215   216   217