shared db plugin + example

this revealed an unresolved race condition (hence the setTimeout in the
example). fix coming.