Michael Bayer wrote:
On Mar 12, 2010, at 6:54 AM, Chris Withers wrote:
Got this error this morning:
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/session.py",
line 247, in _assert_is_active
"The transaction is inactive due to a rollback in a "
sqlalchemy.exc.InvalidRequestError: The transaction is inactive due to a
rollback in a subtransaction. Issue rollback() to cancel the transaction.
I didn't think our app was using subtransactions.
What pattern(s) of code should I be looking for to find whatever might have
casued this?
Seems to have been an annoyingly transient error...
here's a very comprehensive set of answers:
http://www.sqlalchemy.org/trac/wiki/FAQ#Thetransactionisinactiveduetoarollbackinasubtransaction
What does an error like this mean:
return session.query(...).all()
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/query.py",
line 1267, in all
return list(self)
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/query.py",
line 1361, in __iter__
return self._execute_and_instances(context)
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/query.py",
line 1364, in _execute_and_instances
result = self.session.execute(querycontext.statement,
params=self._params, mapper=self._mapper_zero_or_none())
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/orm/session.py",
line 753, in execute
clause, params or {})
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/base.py",
line 824, in execute
return Connection.executors[c](self, object, multiparams, params)
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/base.py",
line 872, in _execute_clauseelement
parameters=params
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/base.py",
line 938, in __create_execution_context
return dialect.execution_ctx_cls(dialect, connection=self, **kwargs)
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/default.py",
line 170, in __init__
self.cursor = self.create_cursor()
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/default.py",
line 258, in create_cursor
return self._connection.connection.cursor()
File
"/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.8-py2.5.egg/sqlalchemy/engine/base.py",
line 576, in connection
raise exc.InvalidRequestError("Can't reconnect until invalid
transaction is rolled back")
sqlalchemy.exc.InvalidRequestError: Can't reconnect until invalid
transaction is rolled back
Asking here as it sounds like it might be related.
It occurred transiently, though, and appears to have resolved itself
without any intervention. Where would I look to find out what caused the
invalid transaction and how it was rolled back?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.