Replace it by a database lock so the different processes are all aware of the lock and the last update timestamp.
This project aim to deal with modules related to manage document printing and sending in a generic way. You'll find modules that: