Looks like the problem is coming because of the fact when we are updating a row in table with the same data the rowcount returned by mysql is 0. Only when there is a change in data the rowcount is returned.
Assuming RollValue column is changing from 99 to 100 if I execute the following statements: UPDATE TABLE_X Set RollValue=100 WHERE ID=100; >> this will return rowcount = 1 Again running this, UPDATE TABLE_X Set RollValue=100 WHERE ID=100; >> will return rowcount = 0 and therefore the transaction fails. Has anything changed in latest version of SA and I recently moved to SA 3.9after post which I am facing this problem. On 7/30/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > On Jul 30, 2007, at 8:13 AM, Arun Kumar PG wrote: > > > Guys, > > > > I am using SA with MySQL. I am trying to update a record by making > > a call to session.update(obj). In response I am getting > > "ConcurrentModificationError: Updated rowcount 0 does not match > > number of objects updated 1" > > > > What are the possible reasons for this error? > > > > the UPDATE statement issued fails to find any rows which match the > expected criterion. the "concurrent" part comes from the idea that > some other process has already updated the row; however if the UPDATE > statement isnt formed correctly, or if the "rowcount" function on > your DBAPI is busted, that will do it too. > > > > -- Cheers, - A --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
