#NEWLINE# def commit( self ) : #NEWLINE# #INDENT# self . _assert_active ( prepared_ok = True ) #NEWLINE# if ( self . _state is not PREPARED ) : #NEWLINE# #INDENT# self . _prepare_impl ( ) #NEWLINE# #UNINDENT# if ( ( self . _parent is None ) or self . nested ) : #NEWLINE# #INDENT# for t in set ( self . _connections . values ( ) ) : #NEWLINE# #INDENT# t [ 1 ] . commit ( ) #NEWLINE# #UNINDENT# self . _state = COMMITTED #NEWLINE# self . session . dispatch . after_commit ( self . session ) #NEWLINE# if self . session . _enable_transaction_accounting : #NEWLINE# #INDENT# self . _remove_snapshot ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . close ( ) #NEWLINE# return self . _parent