积日累月JAVA错误收集,现在还少得很,不过传上来方便以后查找。
序号 错误提示 场景、现象 解决方案 备注
1 ORA-02289: 序列不存在; org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value; SQL [select utility.hibernate_sequence.nextval from dual]; nested exception is org.hibernate.exception.SQLGrammarException: could not get next sequence value Save()添加时;oracle10G;采用的注解ID方式(hibernate-jpa-2.0-api-1.0.0.Final.jar)
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; 创建序列
Create sequence HIBERNATE_SEQUENCE
increment by 1
start with 1
nocycle
cache 20 采用.hbm.xml时可能也是没创建或配置有误
2 无 Save()操作时hibernate.show_sql无
Hibernate:
insert
into
utility.TBL_USER
(VERSION, c_PASSWORD, c_USERID, ID)
values
(?, ?, ?, ?)
输出。序列自动增长了。 save()后马上调用.flush(); 强制立即更新缓存到数据库
序号 错误提示 场景、现象 解决方案 备注
1 ORA-02289: 序列不存在; org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value; SQL [select utility.hibernate_sequence.nextval from dual]; nested exception is org.hibernate.exception.SQLGrammarException: could not get next sequence value Save()添加时;oracle10G;采用的注解ID方式(hibernate-jpa-2.0-api-1.0.0.Final.jar)
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; 创建序列
Create sequence HIBERNATE_SEQUENCE
increment by 1
start with 1
nocycle
cache 20 采用.hbm.xml时可能也是没创建或配置有误
2 无 Save()操作时hibernate.show_sql无
Hibernate:
insert
into
utility.TBL_USER
(VERSION, c_PASSWORD, c_USERID, ID)
values
(?, ?, ?, ?)
输出。序列自动增长了。 save()后马上调用.flush(); 强制立即更新缓存到数据库