[Zope] How to deal with MySQL's LAST_INSERT_ID() sensibly?
As far as I understand from the MySQL manuals, the value of LAST_INSERT_ID() is maintained on a per-connection basis (wish it would be per-connection/per-table; a LAST_INSERT_ID() would make much more sense in combination with table locking, but anyway..). I have a number of ZSqlMethods and Python methods that share a DB connection. I see two kinds of possible race conditions here: 1. Queries to different tables occur simultanously and affect the value of LAST_INSERT_ID(). This could propably be solved by creating multiple connections for each different kind of INSERT command. 2. Multiple requests trigger the same query which leads to confusion. My question is if 2. is really a possible problem. I don't know enough about database adapters and Zope threading. Are queries serialized by DB connections or by SQL Methods? I wonder how others deal with that issue. Maybe I should renounce using auto increment values at all, and maintain my own counters in the runtime state. But how to make these thread safe? Any ideas appreciated - please reply directly to me via email since I'm not subscribed to the list. Stefan www.meso.net ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] error in 2.2.0b3?
When rendering a DTML document with the following content 1/0 failed Zope reports Error Type: TypeError Error Value: unexpected keyword argument: error_type with the traceback below. Am I doing something wrong? If it is a bug and has been reported already, sorry for the noise (I'm currently not subscribed to the list). Stefan Traceback (innermost last): File D:\Programme\Zope2.2.0b3\FTF\lib\python\ZPublisher\Publish.py, line 222, in publish_module File D:\Programme\Zope2.2.0b3\FTF\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\Programme\Zope2.2.0b3\FTF\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: FTF) File D:\Programme\Zope2.2.0b3\FTF\lib\python\ZPublisher\Publish.py, line 171, in publish File D:\Programme\Zope2.2.0b3\FTF\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: mytest) File D:\Programme\Zope2.2.0b3\FTF\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: mytest) File D:\Programme\Zope2.2.0b3\FTF\lib\python\OFS\DTMLDocument.py, line 168, in __call__ (Object: mytest) File D:\Programme\Zope2.2.0b3\FTF\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__ (Object: mytest) File D:\Programme\Zope2.2.0b3\FTF\lib\python\DocumentTemplate\DT_Try.py, line 212, in render File D:\Programme\Zope2.2.0b3\FTF\lib\python\DocumentTemplate\DT_Try.py, line 244, in render_try_except File D:\Programme\Zope2.2.0b3\FTF\lib\python\DocumentTemplate\DT_Util.py, line 262, in namespace TypeError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] MySQLDA Problems with simple constant/function queries
I'm using MySQLDA 1.1.3 on Win32. When I type the following queries into the test tab edit box, I get the traceback below: select LAST_INSERT_ID() or select 1 from Of course "select * from " works. When I look into db.py, the error doesn't look very hard to fix, I think I'll give tomorrow. Is there some API documentation of what a DA is supposed to do? Since the 1.1.4 query() code is identical, I think the problem appears there as well. Please reply to the posting via email directly, since I'm not subscribed to the list. Stefan www.meso.net --- Error Type: KeyError Error Value: unhandled Traceback (innermost last): File D:\Programme\Zope2.2\mensa_m\lib\python\ZPublisher\Publish.py, line 224, in publish_module File D:\Programme\Zope2.2\mensa_m\lib\python\ZPublisher\Publish.py, line 189, in publish File D:\Programme\Zope2.2\mensa_m\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: RoleManager) File D:\Programme\Zope2.2\mensa_m\lib\python\ZPublisher\Publish.py, line 175, in publish File D:\Programme\Zope2.2\mensa_m\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: manage_test) File D:\Programme\Zope2.2\mensa_m\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: manage_test) File D:\Programme\Zope2.2\mensa_m\lib\python\Shared\DC\ZRDB\Connection.py, line 178, in manage_test (Object: RoleManager) File D:\Programme\Zope2.2\mensa_m\lib\python\Products\ZMySQLDA\db.py, line 191, in query KeyError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )