dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Locks

  1. #1
    Erik Cruz Guest

    Locks

    Hi.

    Till now my applications have been small office applications using Access.
    But maybe one of these systems will use SQL Server. Since I have not
    experience with this tool I would like to know in which situations have you
    experienced that a Page Locking can offer better results than Record
    Locking, using ADO and SQL Server?

    Also, I have a simple form with 3 textboxes to show fields of the Northwind
    database on SQL Server, Products table.
    I am testing the different types of cursor and locks but cannot see the
    differences. Using a Pessimistic, Static cursor gives me the same results
    that an Optimistic, static cursor: If 2 users are editing the same record,
    when one client updates the record the other can't proceed. There's no
    differences I found in the 2 situations. How can I test the different types
    of locks to see the real results?

    Thanks.



  2. #2
    Steve Stubbs Guest

    Re: Locks


    Eric,

    If you need to update a table and have others see the changes, or if you
    need a cursor that sees changes others make, you need to use a Dynamic cursor
    and Optimistic locking. Use batch optimistic locking if you are going to
    update several rows at once (with .UpdateBatch). Optimistic locking doesn't
    lock the row until it is updated with the .update method of the recordset.

    I believe a static cursor takes a "snapshot" read and doesn't reflect changes
    to the table while you have the table open.

    You will almost always get better multi-user performance with row-locking
    over page-locking, but raw speed is faster with page locking.

    Steve

    "Erik Cruz" <erikacf@antares.com.br> wrote:
    >Hi.
    >
    >Till now my applications have been small office applications using Access.
    >But maybe one of these systems will use SQL Server. Since I have not
    >experience with this tool I would like to know in which situations have

    you
    >experienced that a Page Locking can offer better results than Record
    >Locking, using ADO and SQL Server?
    >
    >Also, I have a simple form with 3 textboxes to show fields of the Northwind
    >database on SQL Server, Products table.
    >I am testing the different types of cursor and locks but cannot see the
    >differences. Using a Pessimistic, Static cursor gives me the same results
    >that an Optimistic, static cursor: If 2 users are editing the same record,
    >when one client updates the record the other can't proceed. There's no
    >differences I found in the 2 situations. How can I test the different types
    >of locks to see the real results?
    >
    >Thanks.
    >
    >



  3. #3
    Erik Cruz Guest

    Re: Locks

    Hi Steve,

    thanks for the answer.

    Where can I find information about the effects of combining the cursor and
    lock types? The help talks about each of them but not about their
    combinations.

    Thanks.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center