MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / commit

Method commit

lib/sqlalchemy/engine/base.py:991–1014  ·  view source on GitHub ↗

Commit the transaction that is currently in progress. This method commits the current transaction if one has been started. If no transaction was started, the method has no effect, assuming the connection is in a non-invalidated state. A transaction is begun on a :cl

(self)

Source from the content-addressed store, hash-verified

989 return TwoPhaseTransaction(self, xid)
990
991 def commit(self) -> None:
992 """Commit the transaction that is currently in progress.
993
994 This method commits the current transaction if one has been started.
995 If no transaction was started, the method has no effect, assuming
996 the connection is in a non-invalidated state.
997
998 A transaction is begun on a :class:`_engine.Connection` automatically
999 whenever a statement is first executed, or when the
1000 :meth:`_engine.Connection.begin` method is called.
1001
1002 .. note:: The :meth:`_engine.Connection.commit` method only acts upon
1003 the primary database transaction that is linked to the
1004 :class:`_engine.Connection` object. It does not operate upon a
1005 SAVEPOINT that would have been invoked from the
1006 :meth:`_engine.Connection.begin_nested` method; for control of a
1007 SAVEPOINT, call :meth:`_engine.NestedTransaction.commit` on the
1008 :class:`_engine.NestedTransaction` that is returned by the
1009 :meth:`_engine.Connection.begin_nested` method itself.
1010
1011
1012 """
1013 if self._transaction:
1014 self._transaction.commit()
1015
1016 def rollback(self) -> None:
1017 """Roll back the transaction that is currently in progress.

Callers 2

_commit_implMethod · 0.45
do_commitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected