title: Avoid sqlite vacuum "database is locked" by application level retrying
body: <p>I'm using a simple sqlite DB as persistent msg-queueing mechanism between processes. To reduce the file size after exceeding a certain limit I wanted to use the "vacuum" command. Generally all this works nicely, only that every now and then I get a "database is locked" error when vacuuming.</p>
  
  <p>After reading through various resources on the web I understand that there is nothing I can do on sqlite-level.</p>
  
  <p>However, besides the side-questions "Why is that the case? What would be the problem with retrying to obtain the required lock using the regular busyHandler mechanism?" I came up with the idea to just implement the very same busyHandler mechanism just on application level.</p>
  
  <p>Now the essential question: Anything wrong with this?</p>
  
  <p>Many thx!!</p>