Problems inserting into MySQL
I'm working on a site whose data is stored in MySQL. So far I've had no problems with the database connection, but one just came up. The user fills in a form, and the submit calls a Python script that formats the data and passes it to the Z SQL Method that contains the INSERT INTO command. The only data access is this single INSERT command, and it succeeds, at least in the sense that the data is properly inserted into the table. But I get this ugly and hard to understand error message: <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>_mysql_exceptions.NotSupportedError</STRONG></P> Sorry, a site error occurred.<p> <!-- Traceback (innermost last): File /usr/local/ZopeBase/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /usr/local/ZopeBase/lib/python/ZPublisher/Publish.py, line 106, in publish File /usr/local/ZopeBase/lib/python/Zope/__init__.py, line 178, in abort File /usr/local/ZopeBase/lib/python/ZODB/Transaction.py, line 107, in abort File /usr/local/ZopeBase/lib/python/Shared/DC/ZRDB/TM.py, line 60, in abort File /usr/local/ZopeBase/lib/python/Products/ZMySQLDA/db.py, line 328, in _abort NotSupportedError: (1196, "Warning: Some non-transactional changed tables couldn't be rolled back") --> OK, I get that something's wrong, but how do I go about figuring out the problem? I tried using the src__=1 trick to view the generated SQL statement, and that was fine: if I plugged it into a MySQL GUI interface, it ran without problem. And even running through Zope, the data does get properly inserted into the table. So what's up with this error message? ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://foxcentral.net
That error is being genrated by your MySQL server. Here's what the MySQL manual has to say about that error down there: http://www.mysql.com/doc/N/o/Non-transactional_tables.html Not that it tells you much about fixing it. ;-) Rick Ed Leafe wrote:
I'm working on a site whose data is stored in MySQL. So far I've had no problems with the database connection, but one just came up. The user fills in a form, and the submit calls a Python script that formats the data and passes it to the Z SQL Method that contains the INSERT INTO command. The only data access is this single INSERT command, and it succeeds, at least in the sense that the data is properly inserted into the table. But I get this ugly and hard to understand error message:
<H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>_mysql_exceptions.NotSupportedError</STRONG></P>
Sorry, a site error occurred.<p> <!-- Traceback (innermost last): File /usr/local/ZopeBase/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /usr/local/ZopeBase/lib/python/ZPublisher/Publish.py, line 106, in publish File /usr/local/ZopeBase/lib/python/Zope/__init__.py, line 178, in abort File /usr/local/ZopeBase/lib/python/ZODB/Transaction.py, line 107, in abort File /usr/local/ZopeBase/lib/python/Shared/DC/ZRDB/TM.py, line 60, in abort File /usr/local/ZopeBase/lib/python/Products/ZMySQLDA/db.py, line 328, in _abort NotSupportedError: (1196, "Warning: Some non-transactional changed tables couldn't be rolled back") -->
OK, I get that something's wrong, but how do I go about figuring out the problem? I tried using the src__=1 trick to view the generated SQL statement, and that was fine: if I plugged it into a MySQL GUI interface, it ran without problem. And even running through Zope, the data does get properly inserted into the table. So what's up with this error message?
___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://foxcentral.net
_______________________________________________ Zope maillist - Zope@zope.org 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 )
On Thursday, July 25, 2002, at 03:27 PM, D. Rick Anderson wrote:
That error is being genrated by your MySQL server. Here's what the MySQL manual has to say about that error down there: http://www.mysql.com/doc/N/o/Non-transactional_tables.html
Not that it tells you much about fixing it. ;-)
OK, I did a little digging via Google, and found out that if you change the connection string to begin with a hyphen (e.g., instead of "database@host user pass", make it "-database@host user pass"), Zope won't try to use transactions. Good thing, since this is a MySQL MyISAM table that doesn't support transactions! ;-) Once I did that, I got the real error message: there was a typo in some DTML code that was called later on in the script. Now that that's fixed, I'm back in business. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://foxcentral.net
participants (2)
-
D. Rick Anderson -
Ed Leafe