Changes to add transactional support for insert