I'm writing an application in python using sqlalchemy (and Elixir) with sqlite as the database backend. I start a new transaction using the code session.begin_transaction()
, but when I call session.rollback()
I get the following error:
sqlalchemy.exceptions.OperationalError: (OperationalError) no such savepoint: sa_savepoint_1 u'ROLLBACK TO SAVEPOINT sa_savepoint_1' []
I also get a similar error calling session.commit()
. From what I can tell, sqlite supports SAVEPOINTS (http://www.sqlite.org/lang_savepoint.html).
So, how do I get nested transactions to work?