Professional Web Applications Themes

-2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor. - Microsoft SQL / MS SQL Server

Using: MDAC 2.6 SQLOLEDB Provider Microsoft SQL Server 7.00 - 7.00.1077 (Intel X86) This is happening when attempting to update a row that is opened with a Keyset cursor on the client, a VB program. After reading relevant sections of "SQL Books Online", Wrox Press "ADO 2.6" and "Inside SQL Server", it is still not obvious to me how to write a test to find this error in production. The Inside SQL Server and Books Online mainly talk about this error in the context of a Transact-SQL cursor. However, I'm using ADO for a client-side cursor. A clue for the ...

  1. #1

    Default -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    Using:
    MDAC 2.6
    SQLOLEDB Provider
    Microsoft SQL Server 7.00 - 7.00.1077 (Intel X86)

    This is happening when attempting to update a row that is opened with
    a Keyset cursor on the client, a VB program.

    After reading relevant sections of "SQL Books Online", Wrox Press "ADO
    2.6" and "Inside SQL Server", it is still not obvious to me how to
    write a test to find this error in production.

    The Inside SQL Server and Books Online mainly talk about this error in
    the context of a Transact-SQL cursor. However, I'm using ADO for a
    client-side cursor.

    A clue for the clueless please?

    Not grokking,
    Grok
    Grok Guest

  2. #2

    Default Re: -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    You say: 

    yet you already said: 

    Ponder: Haven't you already found the error?

    Consider:

    One no hand, the error message could be correct.
    the row may have already been modified via elsewhere and
    you need to take appropriate action.
    Such as preventing the row from being modified via elsewhere,
    avoid modifiing the row elsewhere,
    or doing something appropriate in your application whenever elsewhere
    happens to modify the rows first.

    On the other hand, the row(s) might not have been modify at all
    and your application has failed to accurately specify what previous
    values are to be expected on the row.

    Thus, a good first step would be to investigate
    a particular occurance of the problem.
    But of course you could have various combinations of the two issues occuring
    so don't declare you are done just because you address one of the issues
    for the another one could be around too.

    Bye,
    Delbert Glass

    "Grok" <net> wrote in message
    news:com... 


    Delbert Guest

  3. #3

    Default Re: -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    try to SET NOCOUNT OFF. some server-side cursors need that count to
    determine if the update is successful.

    HTH,
    </wqw>

    "Grok" <net> wrote in message
    news:com... 


    Vlad Guest

  4. #4

    Default Re: -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    Actually no, haven't found the error. It only occurs in production
    and I cannot duplicate it in the VB IDE debug environment.

    What I need is to understand how the code could be causing this. Is
    this definitely due to an update? Could one process attempting to
    update a row that another process is reading cause this? Are two
    processes attempting to update the same row? I thought that would
    generate a deadlock.

    How can I prevent this? Is it that I don't have a row lock?
    Do I need:
    adUseServer
    adLockPessimistic
    adOpenStatic
    to get a row lock on a row I want to update columns of?

    Thanks again, and again.


    On Wed, 13 Aug 2003 18:04:46 -0500, "Delbert Glass"
    <com> wrote:
     
    >
    >yet you already said: 
    >
    >Ponder: Haven't you already found the error?
    >
    >Consider:
    >
    >One no hand, the error message could be correct.
    >the row may have already been modified via elsewhere and
    >you need to take appropriate action.
    >Such as preventing the row from being modified via elsewhere,
    >avoid modifiing the row elsewhere,
    >or doing something appropriate in your application whenever elsewhere
    >happens to modify the rows first.
    >
    >On the other hand, the row(s) might not have been modify at all
    >and your application has failed to accurately specify what previous
    >values are to be expected on the row.
    >
    >Thus, a good first step would be to investigate
    >a particular occurance of the problem.
    >But of course you could have various combinations of the two issues occuring
    >so don't declare you are done just because you address one of the issues
    >for the another one could be around too.
    >
    >Bye,
    >Delbert Glass
    >
    >"Grok" <net> wrote in message
    >news:com... 
    >[/ref]

    Grok Guest

  5. #5

    Default Re: -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    Once you have a problem updating a particular row
    (say a particular customer, product, invoice, whatever),
    does that particular row tend to stay broken
    (until it mysteriously starts working again)
    ?

    Or to say it differently:
    If you get exit your application (perhaps forceablely),
    get back in,
    and go to that same particular row,
    can you usually update the row
    or does it usually give you the error again?

    Bye,
    Delbert Glass


    Delbert Guest

  6. #6

    Default Re: -2147217864: Optimistic concurrency check failed. The row was modified outside of this cursor.

    The user gets out of the application, goes back in and can complete
    the work (update).

    On Thu, 14 Aug 2003 13:56:05 -0500, "Delbert Glass"
    <com> wrote:
     

    Grok Guest

Similar Threads

  1. Optimistic concurrency control
    By Frank Millman in forum PostgreSQL / PGSQL
    Replies: 3
    Last Post: January 13th, 04:44 PM
  2. Replies: 0
    Last Post: May 13th, 04:40 AM
  3. FW: Check out this modified PC case
    By Dirk Moolman in forum Informix
    Replies: 4
    Last Post: September 18th, 01:05 PM
  4. How can I do this (modified) without a cursor
    By bryan jones in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 1st, 04:30 PM
  5. Optimistic concurrency ... failed. The row was modified outside of this cursor
    By mark baekdal in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: June 30th, 11:02 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139