Implemented transactional Insert/Update.