关于spring +ibatis 数据无法回滚问题

在做一个项目,插入用户的时候,取用户的id值插入艺术家,艺术家表字段有些值不能为空,  然后用户插入成功,但是插入下一条数据的时候,报.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/linkcare/chengart/model/Artist_SqlMap.xml.  
--- The error occurred while applying a parameter map.  
--- Check the artist.insertArtist-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'birth_year' cannot be null,就是数据库的表不能某些字段不能为空,配置文件如下<bean id="sqlMap" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:SqlMap-Config.xml</value>
</property>
<property name="dataSource" ref="dbcpDataSource" />
</bean>
  
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
        <property name="sqlMapClient" ref="sqlMap" />
    </bean>

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
     <property name="dataSource" ref="dbcpDataSource"/>
</bean>

<tx:annotation-driven transaction-manager="transactionManager"/>
无论是编程式跟注解都不成功,我的想法是不是跟表的设计不能为空有影响,抱歉,分数不多望解答
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值