lvhaowen的gravatar头像
lvhaowen 2016-06-12 15:18:10

ibatis抛出Closing non transactional SqlSession异常怎么解决?

DEBUG - ==>  Preparing: select category_id,category_name,level,parent_id,create_time,sffj from product_category
DEBUG - ==> Parameters:
DEBUG - <==      Total: 25
DEBUG - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7271d362]
WARN - Handler execution resulted in exception: null

应该是xml配置的问题,但是我找不出来

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tmhome.mall.dao.ProductCategoryDao">

    <resultMap type="com.tmhome.mall.model.ProductCategory" id="productCategoryMap">
        <result property="categoryId" column="category_id" />
        <result property="categoryName" column="category_name" />
        <result property="level" column="level" />
        <result property="parentId" column="parent_id" />
        <result property="createTime" column="create_time" />
        <result property="sffj" column="sffj"  jdbcType="TINYINT" />
        
    </resultMap>

<select id="selectByPrimaryKey" parameterType="com.tmhome.mall.model.ProductCategory" resultMap="productCategoryMap">
        select category_id,category_name,level,parent_id,create_time, sffj
        from product_category
        where category_id = #{categoryId,jdbcType=INTEGER}
    </select>
    <select id="selectAll" parameterType="com.tmhome.mall.model.ProductCategory" resultMap="productCategoryMap">
        select category_id,category_name,level,parent_id,create_time, sffj
        from product_category
    </select>

</mapper>

所有回答列表(3)
yjx4510013的gravatar头像
yjx4510013  LV9 2016年6月13日

数据库连接是不是没有关闭?也有可以是配置文件那边有问题!你应该帖一些代码或配置文件

lvhaowen的gravatar头像
lvhaowen  LV20 2016年6月13日

<mapper namespace="com.tmhome.mall.dao.ProductCategoryDao">

   <resultMap type="com.tmhome.mall.model.ProductCategory" id="productCategoryMap">
        <result property="categoryId" column="category_id" />
        <result property="categoryName" column="category_name" />
        <result property="level" column="level" />
        <result property="parentId" column="parent_id" />
        <result property="createTime" column="create_time" />
        <result property="sffj" column="sffj"  jdbcType="TINYINT" />
        
    </resultMap>

    <select id="selectByPrimaryKey" parameterType="com.tmhome.mall.model.ProductCategory" resultMap="productCategoryMap">
        select category_id,category_name,level,parent_id,create_time, sffj
        from product_category
        where category_id = #{categoryId,jdbcType=INTEGER}
    </select>

黑子要做攻城狮的gravatar头像
黑子要做攻城狮  LV1 2016年6月21日

ibatis和mybatis语法差不多么?

最近浏览
gmlee2000 2023年3月10日
暂无贡献等级
zybzyb123  LV3 2022年2月11日
铁柱123456 2022年1月22日
暂无贡献等级
sunlea  LV17 2021年12月28日
ja_go_z 2021年12月19日
暂无贡献等级
ccxiao  LV2 2021年11月21日
hs199427  LV1 2021年11月17日
swqswqswq  LV3 2021年10月19日
asd1023 2021年10月15日
暂无贡献等级
木易yzdecm 2021年8月18日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友