#5415: Every SQL query should send a signal
-------------------------------+--------------------------------------------
   Reporter:  adrian           |                Owner:  nobody                
     Status:  new              |            Component:  Database wrapper      
    Version:  SVN              |           Resolution:                        
   Keywords:  feature_request  |                Stage:  Design decision needed
  Has_patch:  1                |           Needs_docs:  1                     
Needs_tests:  0                |   Needs_better_patch:  0                     
-------------------------------+--------------------------------------------
Comment (by gav):

 I agree with the potential performance concern, I just filled out Adrian's
 request. :)

 Two possibilities that spring to mind easily:

 1)  We could make it so the CursorSignalWrapper is only used if
 settings.DEBUG is on, or preferably by a settings.DATABASE_DEBUG flag, so
 query signals can be controlled separately?  Possible concern: this isn't
 easy to change at runtime, since the cursor is already defined as soon as
 the DB connection is instantiated, so it would be rare that this could be
 called early enough.  Fine for simple uses (always on, always off).

 2) A mechanism, something like django.db.connection.enable_signals() which
 wraps the cursor on the connection at that moment.  Easier to change at
 runtime, and can still use (1) to decide whether to trigger it by default.

 Unrelated: if #4561 is fixed (specifically the part "signals are sent
 regardless of whether or not something is listening"), would your concern
 still stand in any significant way?  Is it strictly the dispatcher load,
 or is it just that CursorSignalWrapper is another object.  If it's
 CursorSignalWrapper, how is this different than the old
 CursorDebugWrapper?  They perform much the same role as far as load goes
 (the only difference being the dispatcher, so back to the first part of
 the question).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5415#comment:8>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to