[Zope] "Zope DB instance has no attribute 'lock'"

Joel Burton joel@joelburton.com
Mon, 4 Mar 2002 17:31:54 -0500 (EST)


On Mon, 4 Mar 2002, Derek Simkowiak wrote:

>
> 	I installed the Z MySQL Database Adaptor product and configured a
> connection with the simple 'database username password' connection string.
>
> 	Now I get the above when I try "select * from applicants" in the
> 'test' view of my database adaptor.  I have no idea what it means, or how
> to troubleshoot it.  Is the problem in my database?  In Zope?  WTF?  The
> database connections shows itself as 'open', so I think it can talk to the
> database okay.
>
> 	What do I do next?  I'd post more information but I'm not sure
> what information is necessary... Here is the traceback from the error
> message page's source HTML:
>
> <!--
> Traceback (innermost last):
>   File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 223, in publish_module
>   File /usr/share/zope/lib/python/Products/Localizer/__init__.py, line 53, in new_publish
>   File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 187, in publish
>   File /usr/share/zope/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook
>     (Object: MySQL_database_connection)
>   File /usr/lib/python2.1/site-packages/ZPublisher/Publish.py, line 175, in publish
>   File /usr/share/zope/lib/python/Zope/__init__.py, line 240, in commit
>   File /usr/share/zope/lib/python/ZODB/Transaction.py, line 325, in commit
>   File /usr/share/zope/lib/python/Shared/DC/ZRDB/TM.py, line 122, in tpc_finish
>   File /usr/share/zope/lib/python/Products/ZMySQLDA/db.py, line 351, in _finish
> AttributeError: (see above)
>
> -->

No idea, don't use MySQLFolder. Did want to say that exUserFolder, which
is similar but includes properties & caching, and can use many backends,
works out of the box with MySQL for authentication. (It says its only for
PostgreSQL, and if you want to store new attributes, you'll have to tweak
the SQL slightly for MySQL, but for usernames/passwords/roles, it works
fine w/o changes).

The nice thing about exUserFolder is that if/when you switch
databases/switch to LDAP/switch to SMB authentication/whatever, it will
still be there for you.

-- 

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant