<update >
        ischange = #{ischange,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>

java代码

    public void updateDebtEndForIschange(){
    String buserDate = Util.getTimeDay();
    //查询今天过期的 中间所有债权Buser
    Map<String, Object> buserNewDayMap= new HashMap<String, Object>();
    buserNewDayMap.put("buserDate",buserDate);
    List<Buser> buserList = buserMapper.buserNewDayList(buserNewDayMap);
    if(buserList.size() > 0){
    //修改 债权有分配的Debt
        for (Buser buser : buserList) {
        Map<String, Object> creditorDebtMap= new HashMap<String, Object>();
        creditorDebtMap.put("borrowid",buser.getId());
        List<Debt> debtList = debtMapper.findCreditorDebtTimer(creditorDebtMap);
        for (Debt debt : debtList) {
        debt.setIschange(1);
    debtMapper.updateDebtTimer(debt);//更新被替换的debt的ischange为1
    System.out.println("---------更新被替换的debt  ischange");
        }
        
        }
    }
    }

 

异常信息

[org.mybatis.spring.SqlSessionUtils]Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7bbc8afc]

[org.mybatis.spring.SqlSessionUtils]Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7bbc8afc] from current transaction
[org.mybatis.spring.SqlSessionUtils]Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7bbc8afc]
[org.springframework.jdbc.datasource.DataSourceTransactionManager]Should roll back transaction but cannot - no transaction available
[org.mybatis.spring.SqlSessionUtils]Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7bbc8afc]

[org.springframework.jdbc.datasource.DataSourceUtils]Returning JDBC Connection to DataSource

 

到这里就一直卡住不动了。断点调试的时候,会跳到 InvocationTargetException异常里面去。

 debtMapper.updateDebtTimer(debt);//更新被替换的debt的ischange为1 在这里就弹出错误,就不动了。

 

我的是前面修改xml的时候,字段名写错了,一直没找到原因,网上也很多写的东西,大多都是把英语说明翻译出来,根本解决不了问题。

后来我慢慢查看,就发现有个字段的名字在   数据库,xml和Bean里面不一致,后来改一致就OK了。

 

相关文章:

  • 2021-11-27
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-10
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案