Results 1 to 3 of 3

Thread: Is adLockPessimistic really doing its job?

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    37
    I use ADO2.5 + Oracle + VB6 sp4

    rst.Open "select * from test", conn, adOpenDynamic, adLockPessimistic, adCmdText

    it doesn't lock the record until I run the rst.Update

    Why????

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    I'll Check my code

    You gave me quite a scare so I checked my code and I don't have a problem.

    Difference might be that I specify adCmdTable when opening my table for mods.

    The main reason for this is that I have Class wrappers for all of my data objects so that I have a common "Interface" to use. All of my data objects eventually call upon my data source wrapper to handle updates, deletes or adds.

    Unfortunately I don't have time to do a test for you , but if you used adCmdTable instead of adCmdText, you might find it works? When I changed my working code to open with adCmdText parameter I could not update the database.

    Oh, and I am also only opening an Access db, not Oracle. So maybe the providers do their locking differently. All the manual says is : "Pessimistic locking, record by record—the provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing." So it is possible that Oracle has their own interpretation of "does what is necessary"

    Hope it helps
    Paul Lewis


  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2000
    Posts
    37
    Thanks.
    Yes, you were right. It works for MS Access, but not for Oracle.
    Now I need to find a way in VB, which can lock the Oracle record.

Posting Permissions

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



Click Here to Expand Forum to Full Width