[Zope] MySQL Database not working well with Zope

Kevin Carlson khcarlso@bellsouth.net
Tue, 1 Oct 2002 16:09:23 -0400


This may not address your specific problem, but it may help solve it (and
potentially others).  I had many problems when using MySQL with ODBC and
Zope.  I switched to MySQL Python libraries and ZMySQLDA and have had no
trouble at all.  Get ZMySQLDA from
http://www.zope.org/Members/adustman/Products/ZMySQLDA and then download the
MySQLdb python library.  This might take care of your problem.

Kevin

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
Stephen Fung
Sent: Tuesday, October 01, 2002 12:56 PM
To: zope@zope.org
Subject: [Zope] MySQL Database not working well with Zope


   I'm new to setting up my own Zope and MySQL
Servers, so I'm not sure if I just didn't configure it
correctly or what, but I'm now getting errors when I
try to connect to my MySQL server.
   I'm currently using Zope 2.5.1 and MySQL Max
3.23.51 with the myodbc-2.50.39-nt package, and
connect to the MySQL server using the  Z ODBC Database
Adapter Product.  The root of my Zope installation is
J:\Zope_2-5-1\Ricepail_Com.  It seems to be set up
correctly, as it was working fine at first.  When I
entered some data into a table I created, it worked
fine with zope.  However, when I tried to add longer
entries into a cell of type "text" (smaller,
2-sentence entries worked fine) the database stopped
working, and I'd get the following error page:



Zope Error
Zope has encountered an error while publishing this
resource.

Error Type: sql.error
Error Value: None



----------------------------------------------------------------------------
----

Troubleshooting Suggestions

The URL may be incorrect.
The parameters passed to this resource may be
incorrect.
A resource that this resource relies on may be
encountering an error.
For more detailed information about the error, please
refer to the HTML source for this page.

If the error persists please contact the site
maintainer. Thank you for your patience.


Traceback (innermost last):
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 150, in publish_module
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 114, in publish
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\Zope\__init__.py, line
159, in zpublisher_exception_hook
    (Object: rightbarpages)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 98, in publish
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\ZPublisher\mapply.py,
line 88, in mapply
    (Object: index_html)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 39, in call_object
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\OFS\DTMLDocument.py,
line 127, in __call__
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\DocumentTemplate\DT_String.py,
line 473, in __call__
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\DocumentTemplate\DT_In.py,
line 437, in renderwb
    (Object: sqlGetEverything)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\Shared\DC\ZRDB\DA.py,
line 421, in __call__
    (Object: sqlGetEverything)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\Products\ZODBCDA\db.py,
line 232, in query
sql.error: (see above)



After receiving the above message, if I try to access
another entry from the database, I receive the
following message:



Zope Error
Zope has encountered an error while publishing this
resource.

Error Type: sql.error
Error Value: ('24000', 0, '[Microsoft][ODBC Driver
Manager] Invalid cursor state')



----------------------------------------------------------------------------
----

Troubleshooting Suggestions

The URL may be incorrect.
The parameters passed to this resource may be
incorrect.
A resource that this resource relies on may be
encountering an error.
For more detailed information about the error, please
refer to the HTML source for this page.

If the error persists please contact the site
maintainer. Thank you for your patience.


Traceback (innermost last):
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 150, in publish_module
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 114, in publish
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\Zope\__init__.py, line
159, in zpublisher_exception_hook
    (Object: rightbarpages)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 98, in publish
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\ZPublisher\mapply.py,
line 88, in mapply
    (Object: index_html)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\ZPublisher\Publish.py,
line 39, in call_object
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\OFS\DTMLDocument.py,
line 127, in __call__
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\DocumentTemplate\DT_String.py,
line 473, in __call__
    (Object: index_html)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\DocumentTemplate\DT_In.py,
line 617, in renderwob
    (Object: sqlGetInfo)
  File
J:\ZOPE_2~1\RICEPA~1\lib\python\Shared\DC\ZRDB\DA.py,
line 421, in __call__
    (Object: sqlGetInfo)
  File
J:\Zope_2-5-1\Ricepail_Com\lib\python\Products\ZODBCDA\db.py,
line 198, in query
sql.error: (see above)



I continue to get the above message nomatter what I
do, until I restart the Zope Server.
I think that the error has to do with the Product I
installed and the size of the entry, because when I
delete the row with the long entry and restart Zope,
everything works fine again.  I've tried altering what
I entered into the database, changing the length of
several of the values, but it still doesn't work when
I make the "text" entry more than about 100
characters.  When I go to a command-line interface,
and try to show the contents of the database table,
everything seems to look correct.

Can somebody please help me fix this problem????

~Steve


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

_______________________________________________
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 )