[Zope] Password screens

Andy Dustman adustman@comstar.net
Wed, 7 Jul 1999 22:58:21 -0400 (EDT)


On Wed, 7 Jul 1999, Michel Pelletier wrote:

> As for the mysql issue, I suspect the bottleneck is purely a MySQL thing
> if Zope doesn't behave that way all the time.  Note that even though you
> may be running Zope in threaded mode, the MySQL client library for
> python (which we did not write and do not support) is not thread safe,
> so you should NOT run Zope 2.0 with more than one thread if you want to
> use MySQL.  Someone may want to patch the MySQLDA so that the whole
> thing is wrapped in a lock, or serializes requests before the client
> library is entered.  Either way, given that no one is paying us to do
> it, we probably won't.

Here's the story on MySQL interfaces for Python. The one ZMySQLDA uses is
MySQLmodule-1.4, which is based on mySQLmodule-0.1.4, which is based on
mSQLmodule. MySQLmodule-1.4, according to the README, is developed for
MySQL 3.21.30 and Python 1.5.1. It should be literally thread-safe due to
the Python global interpreter lock, but any blocking calls will block all
threads (i.e. Py_BEGIN_ALLOW_THREADS .. Py_END_ALLOW_THREADS are not
used).

There is another MySQL interface which I have written: MySQLdb. It's not
based off any previous codebase. It does use Py_BEGIN_ALLOW_THREADS ..
Py_END_ALLOW_THREADS so it should be safe to use in a threaded application
(each thread should have it's own connection, as per the MySQL
recommendations). It's designed to work with MySQL 3.22.19 and up and
Python 1.5.2. It's also a much cleaner design (IMHO), which is not hard to
imagine when you see the lineage of MySQLmodule-1.4 (an evil perl-looking
thing). It should be fully compatible with the Python DB API v2.0 (may be
the only Python database module which is at this point; development
paralleled the API spec design). ZMySQLDB should be adaptable to this
module with little effort. The only snag I can think of off-hand is that
MySQLdb will use mxDateTime (Marc-Andre Lemburg's DateTime package) if it
is available. This will conflict with Zope's DateTime module. I will
modify MySQLdb to make it work and play nicely with Zope, if necessary.

http://starship.python.net/crew/adustman/MySQLdb.html

-- 
andy dustman  | programmer/analyst |  comstar communications corporation
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d