@@ -0,0 +1,571 @@
+package com.farmer.baton.service;%0A%0Aimport com.farmer.baton.model.Farmer;%0Aimport com.farmer.baton.repo.FarmerMapper;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Service;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0A@Service%0Apublic class FarmerService %7B%0A    @Autowired%0A    private FarmerMapper farmerMapper;%0A%0A    @Transactional%0A    public void updateTwoFarmers(Farmer farmer1, Farmer farmer2) %7B%0A        farmerMapper.updateZhangsan(farmer1);%0A        farmerMapper.updateWangwu(farmer2);%0A    %7D%0A%0A%0A%7D%0A

add transaction