[Zope] Error setting a session variable

Chris McDonough chrism at plope.com
Thu Jul 22 20:26:27 EDT 2004


I'm not sure this really has anything to do with sessions.  Apparently
during the same request that is run when this code is run, some SQL data
was changed.  Meanwhile, Zope has a "transaction manager" which manages
all of the databases (ZODB and SQL) that are in play within your system.

When a transaction can't be committed due to an error, Zope tries to
abort the transaction.  "Aborting the transaction" means preventing all
databases from committing.  In MySQL's case the abort appears to be
implemented by a rollback and apparently some of your tables don't
support rollback because they are created in a database that isn't
transactional.  Apparently some of your tables support rollback and some
don't, so MySQL complains that it doesn't know what to do instead of
either rolling back (transactions) or not rolling back (no
transactions).

I'm no MySQL expert, but I think you will need to try to figure out how
to configure all of your databases/tables/connections as transactional
in order to support this automatic abort/rollback.

On Thu, 2004-07-22 at 14:46, Norma Silva wrote:
> Hi everybody,
> 
> I'm new to this group. I got the very strange error below while
> setting a SESSION variable. Cannot understand why, because it says it
> is a SQL error.
> 
>  
> 
> Site Error
> 
> An error was encountered while publishing this resource. 
> 
>  
> 
> _mysql_exceptions.NotSupportedError
> 
>  
> 
> Sorry, a site error occurred.
> 
>  
> 
> Traceback (innermost last): 
> 
>  
> 
> Module ZPublisher.Publish, line 163, in publish_module_standard 
> 
> Module Products.PlacelessTranslationService.PatchStringIO, line 45, in
> new_publish 
> 
> Module ZPublisher.Publish, line 108, in publish 
> 
> Module Zope.App.startup, line 226, in abort 
> 
> Module ZODB.Transaction, line 134, in abort 
> 
> Module Shared.DC.ZRDB.TM, line 63, in abort 
> 
> Module Products.ZMySQLDA.db, line 327, in _abort 
> 
> NotSupportedError: (1196, "Warning: Some non-transactional changed
> tables couldn't be rolled back") 
> 
>  
> 
>  
> 
> ----------------------------------------------------------------------
> 
>  
> 
> Thers is no entry on the error log for more information. I'm running
> zope 2.7.0 and also tried on 2.7.2-0. Both gave me the same error.
> 
>  
> 
> The python script code is:
> 
>  
> 
> request = container.REQUEST
> 
> session = request.SESSION
> 
> ##
> 
> request.set('caller', 'processItem')
> 
> if not request.has_key('submit'):
> 
>     return 'NO SUBMIT'
> 
> #
> 
> orderNo = session['orderNo']
> 
> if orderNo == 0:
> 
>     orderNo = context.createOrderHeaderPY()
> 
>     session.set('itemIndex', 1)
> 
>     session.set('orderNo', orderNo)   ## <-- LINE WITH PROBLEM
> 
>     itemIndex = 1
> 
> else:
> 
>     itemIndex = int(session['itemIndex']) + 1
> 
>     session.set('itemIndex', itemIndex)
> 
>     orderNo = session['orderNo']
> 
> #
> 
>  
> 
> I tried setting up another SESSION variable (using a different name
> for it) and it works. This code was working before. It broke when I
> made some changes in other scripts.
> 
>  
> 
> I'd appreciate any help.
> 
>  
> 
> Thanks,
> 
> Norma
> 
> 
> 
> ______________________________________________________________________
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list