[development] The dawn of DB locks

Greg Knaddison greg at pingvox.com
Tue Nov 6 13:39:03 UTC 2007


On Nov 6, 2007 9:54 AM, Earnie Boyd <earnie at users.sourceforge.net> wrote:
> Yes, please and thank you.  Locking tables are still something someone
> might want to do.  Though issuing the sql through db_query is just as
> good, I suppose, having the API just seems more thorough.

To provide some data on the subject...the list of files on the
DRUPAL-5 branch in CVS which contain db_lock_table:

buddylist/buddylist.module:
chatroom/chatroom.module:
commentapproval/commentapproval.module:
community_tags/community_tags.module:
exif/exif.module:
i18n/i18n.module:
localizer/system/includes/cache.inc:
media_mover/media_mover_api.module:
memcache/patches/DRUPAL-5-1-cache-serialize.patch:
memcache/patches/DRUPAL-5-2-cache-serialize.patch:
nodeapproval/nodeapproval.module:
replication/bootstrap.inc.patch:+
reptag/reptag_helper.inc:
reptag/reptag_module.inc:
semantic_search/contrib/SONIA/ext/cache/ffcache.sonia.inc:
trackback/trackback.module:
xbview/xbview_parser.inc:

Some of these are not concerns (e.g the two memcache patches include
it is just in the context - not part of the patch).  It's also
possible that other branches contain more or fewer uses of the
function, but this seems like a valid sample since it's the most
common actively maintained branch.

Among the 1409 modules on the DRUPAL-5 branch there are ~15 modules
that use db_lock_table.  It seems like a fairly infrequently used
function.  I imagine there are workarounds for most of them.

Cheers,
Greg

PS full disclosure of my technique in case there's a flaw:
CVS checkout: cvs -d :pserver at cvs.drupal.org:/cvs/drupal-contrib
export -r DRUPAL-5 contributions/modules/
Number of modules: find ./ -name '*.module' | wc -l
Files that use db_lock_table: grep -r db_lock_table * | gawk {'print
$1'} | sort -u | wc -l

-- 
Greg Knaddison
Denver, CO | http://knaddison.com
World Spanish Tour | http://wanderlusting.org/user/greg


More information about the development mailing list