On Mar 11, 2011, at 7:51 PM, AJAY PATTNI wrote:
> We use sqlalchemy 0.4.6 with Elixir 0.5.2 and zope.sqlalchemy
>
> Every once a while we get this error(see below):
> In a previous thread somebody said, just 'rollback your session when
> the exception is raised'?
>
> We use a global session as follows:
>
> __session__ =
> scoped_session(sessionmaker(twophase=False,transactional=True,autoflush=True,extension=ZopeTransactionExtension()))
>
> All the rest of the transactional machinery is handled by Elixiry
> Entity object.
>
> So my question - how can we rollback in this situation?
>
> We tried to do __session__.remove() which seems to work but then zope
> seems to have a problem after it completes the request.
A description of what this error means from the perspective of SQLAlchemy only,
not that of zope.sqlalchemy for which you should consult their mailing list, is
here:
http://www.sqlalchemy.org/trac/wiki/FAQ#Thetransactionisinactiveduetoarollbackinasubtransaction
However, note that version 0.4.6 of SQLAlchemy is extremely old, and the
mechanics of session and transaction have been largely reworked since then.
The basic idea that a rollback needs to occur is consistent in that version,
however.
Its very likely that some artifact of zope.sqlalchemy is involved in the
production of your error here.
> ======================
> 2011-03-11T10:41:22 ERROR Zope.SiteErrorLog
> http://dragon.initiatesystems.com:8080/ati/txm_inject_orm
> Traceback (innermost last):
> Module ZPublisher.Publish, line 121, in publish
> Module Zope2.App.startup, line 238, in commit
> Module transaction._manager, line 89, in commit
> Module transaction._transaction, line 329, in commit
> Module transaction._transaction, line 446, in _commitResources
> Module zope.sqlalchemy.datamanager, line 76, in tpc_vote
> Module sqlalchemy.orm.session, line 263, in commit
> Module sqlalchemy.orm.session, line 176, in _assert_is_open
> InvalidRequestError: The transaction is closed
> =====================
>
> Appreciate any help I can get on this.
>
> ================
> Mar 4 12:56:23 pbrk4.den05.accenx.com [err]
> https://acm.accenx.com/mapsrvcluster/ati/acm/tdm/group/19150/broker/25150/site/705077435/processMsg#012Traceback
> (innermost last):#012 Module ZPublisher.Publish, line 115, in
> publish#012 Module ZPublisher.mapply, line 88, in mapply#012 Module
> ZPublisher.Publish, line 41, in call_object#012 Module
> Shared.DC.Scripts.Bindings, line 313, in __call__#012 Module
> Shared.DC.Scripts.Bindings, line 350, in _bindAndExec#012 Module
> Products.PythonScripts.PythonScript, line 326, in _exec#012 Module
> None, line 90, in processMsg#012 - <PythonScript at /ati/acm/tdm/group/
> processMsg used for /ati/acm/tdm/group/19150/broker/25150/site/
> 705077435>#012 - Line 90#012 Module Shared.DC.Scripts.Bindings, line
> 313, in __call__#012 Module Shared.DC.Scripts.Bindings, line 350, in
> _bindAndExec#012 Module Products.PythonScripts.PythonScript, line 326,
> in _exec#012 Module None, line 131, in translate#012 - <PythonScript
> at /ati/acm/tdm/group/19150/broker/25150/site/705077435/outbound/
> translate>#012 - Line 131#012 Module Shared.DC.Scripts.Bindings, line
> 313, in __call__#012 Module Shared.DC.Scripts.Bindings, line 350, in
> _bindAndExec#012 Module Products.PythonScripts.PythonScript, line 326,
> in _exec#012 Module None, line 99, in callTxm#012 - <PythonScript at /
> ati/acm/tdm/group/19150/broker/25150/site/705077435/outbound/
> callTxm>#012 - Line 99#012 Module Shared.DC.Scripts.Bindings, line
> 313, in __call__#012 Module Shared.DC.Scripts.Bindings, line 350, in
> _bindAndExec#012 Module Products.PythonScripts.PythonScript, line 326,
> in _exec#012 Module None, line 44, in txm_ampiWrapperOrm#012 -
> <PythonScript at /ati/acm/tdm/group/19150/broker/25150/
> BrokerMapFunctions/TxmFunctions/txm_ampiWrapperOrm>#012 - Line 44#012
> Module Shared.DC.Scripts.Bindings, line 313, in __call__#012 Module
> Shared.DC.Scripts.Bindings, line 350, in _bindAndExec#012 Module
> Products.PythonScripts.PythonScript, line 326, in _exec#012 Module
> None, line 22, in getTransactionTypes#012 - <PythonScript at /ati/acm/
> tdm/group/19150/broker/25150/BrokerMapFunctions/TxmFunctions/
> getTransactionTypes>#012 - Line 22#012 Module Products.txm.txm, line
> 537, in txmQuery#012 Module Products.txm.txm_functions, line 139, in
> __init__#012 Module elixir.entity, line 854, in get_by#012 Module
> sqlalchemy.orm.query, line 907, in first#012 Module
> sqlalchemy.orm.query, line 935, in __iter__#012 Module
> sqlalchemy.orm.session, line 768, in _autoflush#012 Module
> sqlalchemy.orm.session, line 786, in flush#012 Module
> sqlalchemy.orm.unitofwork, line 230, in flush#012 Module
> sqlalchemy.orm.session, line 499, in begin#012 Module
> sqlalchemy.orm.session, line 178, in _begin#012 Module
> sqlalchemy.orm.session, line 166, in
> _assert_is_active#012InvalidRequestError: The transaction is inactive
> due to a rollback in a subtransaction and should be closed
> =========
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/sqlalchemy?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.