Hi,

I'm getting the following error in one of my unit tests, while I have
never opened a subtransaction. The only thing that happens in that
test is that a first db_session.flush() raises an IntegrityError (this
is deliberate, because I test the generation of an unique number).
Then a second db_session.flush() succeeds, but for some reason the
subsequent commit raises this weird error.

Could someone clarify why sqlalchemy thinks I've got a subtransaction
in there?

======================================================================
ERROR: XXX.tests.test_logement.TestLogement.test_generer_decharge
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/
case.py", line 182, in runTest
    self.test(*self.arg)
  File "/home/antoine/ftth/XXX/XXX/tests/test_logement.py", line 92,
in test_generer_decharge
    db_session.commit()
  File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.5.4p2-py2.6.egg/
sqlalchemy/orm/scoping.py", line 121, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.5.4p2-py2.6.egg/
sqlalchemy/orm/session.py", line 673, in commit
    self.transaction.commit()
  File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.5.4p2-py2.6.egg/
sqlalchemy/orm/session.py", line 378, in commit
    self._prepare_impl()
  File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.5.4p2-py2.6.egg/
sqlalchemy/orm/session.py", line 351, in _prepare_impl
    self._assert_is_active()
  File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.5.4p2-py2.6.egg/
sqlalchemy/orm/session.py", line 247, in _assert_is_active
    "The transaction is inactive due to a rollback in a "
InvalidRequestError: The transaction is inactive due to a rollback in
a subtransaction.  Issue rollback() to cancel the transaction.

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to