-----Original Message----- From: CURTIS David [mailto:David.Curtis@state.or.us] Sent: Wednesday, July 07, 1999 10:49 AM To: zope@zope.org Subject: [Zope] Password screens
Friends of Zope,
I am needing a password screen so that certain users who can edit a database can "log-in" to Zope and others do not. Has anyone done this? If so how does one achieve this? Can Zope use CGI-BIN or SSI includes scripts/programs as the password screens. My system is Redhat Linux 6.0/mysql 3.22/zope 1.10..3 Also, Zope seems to be slow(at times) when accessing records on mysql. Are there any performance tricks that can be utilized? Thanks in advance for any help!
Do you mean a form that autenticates the user? Zope uses HTTP basic authentication, which is what pops up the dialog box. Any other method you want to use (cookies, form variables being passed around) you'd have to roll your own. Note that UserDB does cookie auth as well as basic. 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. -Michel
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
This is very interesting to hear... I am just about to connect a MySQL database to Zope 2.0.0a3 using ZMySQLDA. I understand the problem, but how do I make sure Zope is running single-threaded? As I understand ZServer runs multithreaded (provided Python is compiled --with-threads) and ZopeHTTPServer runs on a single thread. Question: Can I tell ZServer to run with a single thread, and if yes, how so? Or do I have to use ZopeHTTPServer if I want single thread? Jens Vagelpohl
-----Original Message-----
<snip snip>
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.
-Michel
<snip snip>
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.
Which database adapters are thread safe? I don't see this information anywhere on the web site, it'd be nice to know. :) Thanks, --- John Eikenberry [jae@kavi.com - http://taos.kavi.com/~jae/] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin
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
participants (4)
-
Andy Dustman -
Jens Vagelpohl -
John Eikenberry -
Michel Pelletier