Hello,

I am getting the below exception :

Traceback (most recent call last):
  File "d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py", line 134, in
sqlCommit
    self.session.commit()
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\session.py",
line 668, in commit
    self.transaction.commit()
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\session.py",
line 374, in commit
    self._prepare_impl()
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\session.py",
line 358, in _prepare_impl
    self.session.flush()
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\session.py",
line 1358, in flush
    self._flush(objects)
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\session.py",
line 1426, in _flush
    flush_context.execute()
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\unitofwork.py",
line 261, in execute
    UOWExecutor().execute(self, tasks)
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\unitofwork.py",
line 758, in execute
    self.execute_delete_steps(trans, task)
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\unitofwork.py",
line 777, in execute_delete_steps
    self.delete_objects(trans, task)
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\unitofwork.py",
line 764, in delete_objects
    task.mapper._delete_obj(task.polymorphic_todelete_objects, trans)
  File
"c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5060-py2.4.egg\sqlalchemy\orm\mapper.py",
line 1349, in _delete_obj
    raise exc.ConcurrentModificationError("Deleted rowcount %d does not
match number of objects deleted %d" % (c.rowcount, len(del_objects)))
ConcurrentModificationError: Deleted rowcount 0 does not match number of
objects deleted 1

when trying to delete a UserObject which is in the DB. When is this
exception raised? Is there anything wrong...

the function where I get this exception is below :

    def DropUserDB(self,progressFunct = None, args = (), sleepTime = .2):
        userList =
self.session.query(RSITerm.SQLConvert.SqlUser.SqlUser).all()
        if userList == []:
            msg = "No Users in Users DB!"
            self.LogInfo(msg)
            return

        total = len(userList)
        counter = 0
        self.LogInfo('SqlDB.DropUserDB(): Dropping User Database...')
        for user in userList:
            try:
                self.session.delete(user)
                if not self.sqlCommit():
                    msg = "SqlDB.DropUserDB : Error in Commit!"
                    self.LogInfo(msg)
                    return
            except:
                msg = "SqlDB.DropUserDB : Error deleting user!"
                self.LogInfo(msg)
                printException(msg,False)
                return

Thanks !

-- 
Regards,
Harish

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to