[okfn-help] mysql support status for vdm?

Martijn Faassen faassen at startifact.com
Mon Oct 18 17:25:10 BST 2010


Hi there,

I have the mysql support for vdm sitting out on a bitbucket fork of
the project. I'd like to get this merged into the main repository as
soon as possible, and then we can make a new release of vdm with this
support in there. After this I can work on reorganizing the package
structure and the pending stuff.

http://bitbucket.org/faassen/vdm

There are a few questions, however:

* we don't have a good way to run the tests for postgresql and mysql.
Any ideas? Right now I just hack a different connection url into
demo.py.

* I need to somehow detect whether mysql is in use in
make_revision_table and use a different DateTime implementation. I
think the simplest way is to define a new parameter 'mysql' that's set
default to False and use it for MySQL support. It's a bit ugly to make
the developer aware of this, but there is no way to know what kind of
connection is going to be in use when are calling make_revision_table
as far as I can see.

* I have a project sa_mysql_dt sitting in bitbucket too that
implements the alternate DateTime which is backed by a decimal. it's
already a python package dedicated to MySQL only, with its own tests.
Can't we simply depend on that for mysql support? It's reusable for
other projects too. I'd rather do that than merge this code into vdm.
We can make it so that the dependency 'vdm [mysql]'  (used with
easy_install, for instance) automatically pulls in this extra
dependency too.

* I get one test failure with this MySQL support and I need help debugging it:

ERROR: vdm.sqlalchemy.test_demo.Test_05_RevertAndPurge.test_purge_revision
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/nose-0.11.4-py2.6.egg/nose/case.py",
line 186, in runTest
    self.test(*self.arg)
  File "/home/faassen/projects/vdm-mysql/vdm/sqlalchemy/test_demo.py",
line 466, in test_purge_revision
    repo.purge_revision(rev2)
  File "/home/faassen/projects/vdm-mysql/vdm/sqlalchemy/tools.py",
line 200, in purge_revision
    self.commit_and_remove()
  File "/home/faassen/projects/vdm-mysql/vdm/sqlalchemy/tools.py",
line 110, in commit_and_remove
    self.commit()
  File "/home/faassen/projects/vdm-mysql/vdm/sqlalchemy/tools.py",
line 100, in commit
    self.session.commit()
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/scoping.py",
line 127, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py",
line 671, in commit
    self.transaction.commit()
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py",
line 378, in commit
    self._prepare_impl()
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py",
line 362, in _prepare_impl
    self.session.flush()
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py",
line 1354, in flush
    self._flush(objects)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/session.py",
line 1432, in _flush
    flush_context.execute()
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/unitofwork.py",
line 261, in execute
    UOWExecutor().execute(self, tasks)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/unitofwork.py",
line 756, in execute
    self.execute_delete_steps(trans, task)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/unitofwork.py",
line 778, in execute_delete_steps
    self.delete_objects(trans, task)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/unitofwork.py",
line 762, in delete_objects
    task.mapper._delete_obj(task.polymorphic_todelete_objects, trans)
  File "/home/faassen/ve_vdm/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py",
line 1549, in _delete_obj
    "number of objects deleted %d" % (c.rowcount, len(del_objects)))
ConcurrentModificationError: Deleted rowcount 0 does not match number
of objects deleted 1

Regards,

Martijn



More information about the okfn-help mailing list