[Zope-dev] zope.sqlalchemy

Andreas Jung lists at zopyx.com
Thu May 8 23:01:45 EDT 2008



--On 6. Mai 2008 06:01:14 +0200 Andreas Jung <lists at zopyx.com> wrote:

>
>
> --On 6. Mai 2008 02:26:58 +0100 Laurence Rowe <l at lrowe.co.uk> wrote:
>
>> Following discussions with Kapil, Christian and Martin I've developed
>> zope.sqlalchemy. The aim is to provide a common base for transaction
>> integration. It does not attempt to define any particular way to handle
>> database configuration as there is not yet consensus on the best way to
>> handle it.

>
> Looks great (on the paper :-)). Trying to integrate it with
> z3c.sqlalchemy over the weekend. Thanks Laurence.

I got a big stuck with the zope.sa integration in z3c.sa. Two tests of my 
testsuite fail (likely related to a session.save() operation):

Error in test testXXMapperGetMapper 
(z3c.sqlalchemy.tests.testSQLAlchemy.WrapperTests)
Traceback (most recent call last):
  File "/opt/python-2.4.4/lib/python2.4/unittest.py", line 260, in run
    testMethod()
  File 
"/Users/ajung/sandboxes/z3c.sqlalchemy/lib/python/z3c/sqlalchemy/tests/testSQLAlchemy.py", 
line 168, in testXXMapperGetMapper
    user = session.query(User).filter_by(firstname='foo')[0]
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/SQLAlchemy-0.4.5-py2.4.egg/sqlalchemy/orm/query.py", 
line 834, in __getitem__
    return list(self[item:item+1])[0]
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/SQLAlchemy-0.4.5-py2.4.egg/sqlalchemy/orm/query.py", 
line 925, in __iter__
    self.session._autoflush()
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/SQLAlchemy-0.4.5-py2.4.egg/sqlalchemy/orm/session.py", 
line 747, in _autoflush
    self.flush()
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/SQLAlchemy-0.4.5-py2.4.egg/sqlalchemy/orm/session.py", 
line 757, in flush
    self.uow.flush(self, objects)
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/SQLAlchemy-0.4.5-py2.4.egg/sqlalchemy/orm/unitofwork.py", 
line 236, in flush
    session.extension.after_flush(session, flush_context)
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/zope.sqlalchemy-0.1dev_r86482-py2.4.egg/zope/sqlalchemy/datamanager.py", 
line 187, in after_flush
    invalidate(session)
  File 
"/opt/python-2.4.4/lib/python2.4/site-packages/zope.sqlalchemy-0.1dev_r86482-py2.4.egg/zope/sqlalchemy/datamanager.py", 
line 170, in invalidate
    assert _SESSION_STATE[id(session)] is not STATUS_READONLY
KeyError: 32500656

The integration code follows your documentation;

<http://svn.zope.org/z3c.sqlalchemy/branches/zope.sqlalchemy-integration/src/z3c/sqlalchemy/base.py?rev=86543&view=auto>

And the tests are here:

<http://svn.zope.org/z3c.sqlalchemy/branches/zope.sqlalchemy-integration/src/z3c/sqlalchemy/tests/testSQLAlchemy.py?rev=86552&view=markup>

Any idea?

Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20080509/7db1ef06/attachment.bin


More information about the Zope-Dev mailing list