#NEWLINE# def savepoint( self ) : #NEWLINE# #INDENT# '\n        Creates a savepoint inside the current transaction. Returns an\n        identifier for the savepoint that will be used for the subsequent\n        rollback or commit. Does nothing if savepoints are not supported.\n        ' #NEWLINE# if ( not self . _savepoint_allowed ( ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# thread_ident = thread . get_ident ( ) #NEWLINE# tid = str ( thread_ident ) . replace ( '-' , '' ) #NEWLINE# self . savepoint_state += 1 #NEWLINE# sid = ( 's%s_x%d' % ( tid , self . savepoint_state ) ) #NEWLINE# self . validate_thread_sharing ( ) #NEWLINE# self . _savepoint ( sid ) #NEWLINE# return sid