Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    record lock violation (2000 SR-2)

    I have a piece of code that needs to make a bulk update to a lot of load limits in my database. Structure is such that an appliance will have components, the components have limits. If a limit is changed on one component, all like-named components need to have their limits changed as well at the user's discretion. I have supplied a button to do this. After confirmation has been received, I build a query similar to "update limit-record set limit-number = new-limit-number where limit desc = current-limit-desc"

    I get a warning that I am about to update 213 records. This is good.
    I then get a second warning stating that 19 records can not be updated due to record lock violations. This is bad.

    I have no record locking defined in my database, and if I change locking to 'edited record' I still get the same error.

    Why aren't those last 19 records updating ? Please help !

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: record lock violation (2000 SR-2)

    Is this a multi user database, are others operating while you try this?
    If a single user database, where have you put this button, on a form that is perhaps locking records.
    Pat

  3. #3
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record lock violation (2000 SR-2)

    This is a multi-user database, although I am making the changes myself on my own machine (no other users) for deployment once I get it working.

    So technically, it is a multi-user database.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: record lock violation (2000 SR-2)

    Would you like to post your actual UPDATE query here, as it will give us a better understanding of what you are doing.
    Pat

  5. #5
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record lock violation (2000 SR-2)

    The acutal update is as follows:

    UPDATE PTBL_TRIAL_AGENDAS SET UPDATED_BY = 'Changes copied By: Developer', UPDATED_DT = #3/26/2003 1:37:40 PM#, TRIAL_AGENDA_1 = 'ABC TESTING CO' WHERE TRIAL_AGENDA_1 = 'ENG 210-005' and TA1_ISSUE_DATE = #1/1/1999# AND TRIAL_AGENDA_2 IS NULL

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: record lock violation (2000 SR-2)

    What I meant by Single vs Multi user database was, are other people operating the database while you are trying your UPDATE query.

    Is your database split into a FE/BE scenario, in other words, if you have a backend that is out on the network where others could be using it (because their FE is linked to it's tables) could cause you problems.

    There seems nothing wrong with your UPDATE query except that there is no space between the apostrophe and WHERE.

    Other than the above, I cannot help, maybe someone else can see what the problem is.
    Pat

  7. #7
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record lock violation (2000 SR-2)

    Yes, the database is a standard fe/be setup with the data on a shared network drive and the user interface distributed on the user's pc's.

    But while making the changes, I have both on my local hard disk, so there should not be any network issues. Yet . :-)

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: record lock violation (2000 SR-2)

    Where are you running this query from? Are you running it from a form which has a record locked that will inadvertantly lock relating records?
    Pat

  9. #9
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record lock violation (2000 SR-2)

    Yes, it is being run from a form (a command button, acutally) before the user commits the updates.

    The database is defined with no locks, though. And there are 19 records not being updated, not just one.

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: record lock violation (2000 SR-2)

    There might only be one record not committed, but with page locking you will probably that there are the 19 records in the page that are locked.
    Why don't you save that record before running the UPDATE query.
    Pat

  11. #11
    Star Lounger
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record lock violation (2000 SR-2)

    What a great idea. Silly me for forgetting about that.

    A quick me.requery before the SQL and the problem is gone. 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
  •