#NEWLINE# def close( self ) : #NEWLINE# #INDENT# self . session . transaction = self . _parent #NEWLINE# if ( self . _parent is None ) : #NEWLINE# #INDENT# for ( connection , transaction , autoclose ) in set ( self . _connections . values ( ) ) : #NEWLINE# #INDENT# if autoclose : #NEWLINE# #INDENT# connection . close ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# transaction . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . _state = CLOSED #NEWLINE# if self . session . dispatch . after_transaction_end : #NEWLINE# #INDENT# self . session . dispatch . after_transaction_end ( self . session , self ) #NEWLINE# #UNINDENT# if ( autoclose . _parent is None ) : #NEWLINE# #INDENT# if ( not self . session . autocommit ) : #NEWLINE# #INDENT# self . session . begin ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . session = None #NEWLINE# self . _connections = None