Could you please use groups and pessimistic locks like in https://github.com/opscode-cookbooks/wordpress/blob/master/Gemfile