Better implementation of dbBegin