On 10/11/2016 11:05 PM, Florian Ruechel wrote:
Following this guide
http://docs.sqlalchemy.org/en/latest/orm/session_transaction.html#joining-a-session-into-an-external-transaction-such-as-for-test-suites
using SQLite I created the following test code:

from sqlalchemy import create_engine
from sqlalchemy.orm import Session


engine = create_engine('sqlite:///:memory:', echo=True)
conn = engine.connect()
trans = conn.begin()
session = Session(bind=conn)
session.begin_nested()
session.execute('SELECT 1')
session.commit()
session.begin_nested()
session.execute('SELECT 1')
session.rollback()
trans.rollback()
conn.close()

Running this throws an exceptions:
"/Users/fruechel/.virtualenvs/foo/lib/python2.7/site-packages/sqlalchemy/engine/default.py",
line 462, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such
savepoint: sa_savepoint_1 [SQL: u'RELEASE SAVEPOINT sa_savepoint_1']

I tested this with Python 2.7 & 3.5 and on SQLAlchemy 1.0.13, 1.0.15 and
1.1.1 and get the same result. Using PostgreSQL instead works perfectly
fine and issues the expected queries.

Before reporting this as a bug I wanted to make sure I'm not missing
something, hence this mail.

yes, you are missing something. Read this: http://docs.sqlalchemy.org/en/rel_1_1/dialects/sqlite.html#pysqlite-serializable






--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sqlalchemy+unsubscr...@googlegroups.com
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to