Results 1 to 2 of 2

Thread: Please suggest answer

  1. #1
    Join Date
    Jan 2003
    Location
    Hyderabad
    Posts
    23

    Please suggest answer

    Give the suitable answer for the below question and explain the answer.

    1.You have designed the database for a Web site (or online ticketing agency) that is used to purchase concert tickets. During a ticket purchase, a buyer view a list of available tickets, decides whether to buy the tickets, and then attempts to purchase the tickets. This list of available tickets is retrieved in a cursor.
    For popular concerts, thousands of buyers might attempt to purchase tickets at the same time. Because of the potentially high number of buyers at any one time, you must allow the highest possible level of concurrent access to the data. How should you design the cursor?

    (A). Create a cursor within an explicit transaction, and set the transaction isolation level to REPEATABLE READ.
    (B). Create a cursor that uses optimistic concurrency and positioned updates. In the cursor, place the positioned UPDATE statements within an explicit transaction.
    (C). Create a cursor that uses optimistic concurrency. In the cursor, use UPDATE statements that specify the key value of the row to be updated in the WHERE clause, and place the UPDATE statements within an implicit transaction.
    (D). Create a cursor that uses positioned updates. Include the SCROLL_LOCKS argument in the cursor definition to enforce pessimistic concurrency. In the cursor, place the positioned UPDATE statements within an implicit transaction.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Are you preparing for MCDBA or something?. If you have bought a book then it will have explanation for such questions.

    Anyway, for concurrency options A and D are out. Option C may update a row even if it changed after it was retrieved in the cursor. The right answer would be B, if the row has changed then you will get an error and you need to handle it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •