异常汇总

1.

异常:

org.springframework.dao.TransientDataAccessResourceException:

Cannot change the ExecutorType when there is an existing transaction

场景:添加资源信息时,需要同时添加目录信息列(是批量添加),所以在MdContentsServiceImpl类的addMdContents()中需要执行两次添加功能,分别是添加资源信息批量添加目录信息列;

 

原因:是由于批量添加引起的,网上说是由于添加和批量添加的Executor类型不同。

==参考博客==

https://stackoverflow.com/questions/37114516/spring-boot-mybatisbatchitemwriter-cannot-change-the-executortype-when-there-is

 

解决方案:暂无

 

POSTMAN测试地址:景颢数据中心->目录管理->添加目录

http://localhost:8080/jhpt-demo/hzjh/demo/MdContents/addMdContents

 

 

5.

问题:

5.1 使用$符号获取map数据有两种方式:${strMap['tableName']}和

     ${strMap.tableName},这两种方式不受输入参数的限制;

5.2 使用#号获取map数据有三种方式:#{strMap['tableName']}和

#{strMap.tableName},另外一种就是#{strMap[tableName]},

注意这种方式的键值不需要写单引号,但是输入参数却只能是map类型,如果是自定义JavaBean,在服务器启动的时候就会报错;

 

<select id="countDataNumOfTable" resultType="map" parameterType="MdContents">
        select count(*) as dataNum from  #{strMap[tableName]}
    </select>

 

 

 

异常:

java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'strMap[tableName]'.  

It was either not specified and/or could not be found for the javaType / jdbcType combination specified.

场景:使用#和$符号去获取map数据

 

原因:暂无

 

 

 

原文地址:https://www.cnblogs.com/syjp/p/11081753.html