Zend db nested transactions

This PR relies on #5001. The goal of this PR is to allow nested db transactions, for instance when tou batch a low level method.