Thanks for getting this into shape, LGTM. FWIW, I have been running with DB_RETRY_LOCK for the past couple of months on a fairly large mail spool (500K emails), a high incoming volume and many tagging rules. So far it's been working great. No deadlocks, any delays waiting for locks are barely noticeable and it's so nice not having to deal with those annoying "already locked" failures. -- Istvan