[Zope-DB] sql query works in database connector but not in ZSQL method

robert rottermann robert at redcor.ch
Wed Jan 17 12:27:12 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> 
> Robert,
> 
> Looks very much like an issue due to transactions. Are you using auto-commit 
> on either the MySQLdb connection or the zope database adapter? Perhaps
> you could test the issue by placing get_transaction().commit() before
> the start of your zope database code, and get_transaction().commit() at
> the end. Please don't do this in production code, this is just to
> isolate the issue.
> 
> Regards,
> Kevin
> 

I tried that, it did not help BUT, I then looked at the console output.
this is what I get (without the extra commit())


2007-01-17 17:59:41 CRITICAL txn.1082132800 A storage error occurred
during the second phase of the two-phase commit.  Resources may be in an
inconsistent state.
eGenix mxODBC Zope DA: WARNING:
<Products.mxODBCZopeDA.ZopeDA.DatabaseConnection "DSN=myodbc" thread
1082132800/1082132800 at 0x5b24710> could not rollback the transaction -
the data source does not support transactions; this may result in data
inconsistencies !
2007-01-17 17:59:41 ERROR Zope.SiteErrorLog
http://localhost:9880/scout/scout/AAUserInfo
Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 325, in _exec
  Module None, line 2, in AAUserInfo
   - <PythonScript at /scout/scout/AAUserInfo>
   - Line 2
  Module Products.RedScout.RedScoutTool, line 96, in getUserDataById
  Module transaction._transaction, line 380, in commit
  Module transaction._transaction, line 378, in commit
  Module transaction._transaction, line 441, in _commitResources
  Module transaction._transaction, line 563, in tpc_finish
  Module Shared.DC.ZRDB.TM, line 60, in tpc_finish
  Module Products.mxODBCZopeDA.ZopeDA, line 1126, in _finish
  Module Products.mxODBCZopeDA.ZopeDA, line 999, in errorhandler
OperationalError: ('HYT00', 2014, "[unixODBC][MySQL][ODBC 3.51
Driver]Commands out of sync; you can't run this command now", 1199)

so it seems to be a transaction error caused by zope.
I *think*, autocommit is not enabled.

however, the odcb driver complains that the datasource does not support
transactions. I just wonder if I have to enable that specifically.
(my odbc knowledge i VERRY small).

robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFFrlxwGaryJ0T9kUYRAiqGAJ4x12oZMQs4geNvw4LCVJT7prRuGQCfUEUV
2GJ5vG0NjtOP+Gz7hyEko9Q=
=2okG
-----END PGP SIGNATURE-----


More information about the Zope-DB mailing list