数据库操作异常信息总结,持续添加中

情景再现:
string sql = "delete from tv_favorite where id in (1,2)";this.getsession.createquery(sql);
 not supported for dml operations<br>一般这种错误的原因是你用update()执行了select语句,或者用query()执行了insert或delete语句。
 
org.hibernate.id.identifiergenerationexception: ids for this class must be manually assigned before calling save(): bestv.tv.entity.epg.epgfavorite主键不能为空
  
 
org.springframework.orm.hibernate3.hibernatejdbcexception: jdbc exception on hibernate data access; nested exception is org.hibernate.exception.sqlgrammarexception: could not execute jdbc batch update看报错是主键冲突了,应该是在insert的时候吧。用的什么数据库,如果是mysql,那你的表是myisam表结构的么,如果是,那么你的id是指定autoincrement么?如果答案仍然是肯定的,那么我建议你先不要依赖id的autoincrement,自己指定id试试,其他code不动,如果这样就能插入了,就是说mysql自身有些问题,myisam这个存储引擎自身有点问题,免费的东东嘛。如果说你用的oracle之类的数据,嗯,oracle不支持autoincrement,得用sequence来实现类似的功能,应该没事。anyway,我的意思是说,如果你用mysql,先排查一下,我怀疑是数据库自身的问题,如果你用的是oracle的话,我觉得不用太怀疑数据库了,查自己的code吧
 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值