spring data jpa 事务问题 Executing an update/delete query
时间: 2013-10-12来源:开源中国
前景提要
HDC调试需求开发(15万预算),能者速来!>>>


spring 3.2 spring data jpa 1.3 hibernate4 db为mysql5.5. default-storage-engine=INNODB
错误:


Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query
这是代码:
@Transactional
public void saveAuthority(String []ids,String roleId){
//调用 delRoleAuthority方法
}
@Modifying
@Query("delete from Authority t where t.role.id=:roleId")
public int delRoleAuthority(@Param("roleId") String roleId);
我已经加了 @Transactional 但还是没事务。搞 不这了,,配置应该没错。不知道什么问题啊
我其它数据是可以新增的,就是 @Modifying这种方式写的没有事实 ,,求指教!!!





科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行