Dit specifieke gebruiksscenario wordt apart genoemd in "Understanding Autocommit":
Full control of the “autocommit” behavior is available using the generative
Connection.execution_options()method provided onConnection,Engine,Executable, using the “autocommit” flag which will turn on or off the autocommit for the selected scope. For example, atext()construct representing a stored procedure that commits might use it so that a SELECT statement will issue a COMMIT:engine.execute(text("SELECT my_mutating_procedure()").execution_options(autocommit=True))
De manier waarop SQLAlchemy's autocommit dataveranderende operaties detecteert, is door het statement tegen een patroon te matchen, op zoek naar dingen als UPDATE, DELETE en dergelijke. Het is voor SQLAlchemy onmogelijk te detecteren of een opgeslagen functie/procedure mutaties uitvoert, en daarom is er expliciete controle over autocommit.
De reeks wordt zelfs bij een fout opgehoogd omdat nextval()- en setval()-aanroepen nooit worden teruggerold.