could not get next sequence value
来源:互联网 发布:索尼rx100一代知乎 编辑:程序博客网 时间:2024/05/01 03:49
</pre>已经解决:could not get next sequence value<p></p><p>自己搭建测试项目,save()时报错。</p><p>【我的环境】</p><p>系统环境:Ubuntukylin14.04+jdk1.7</p><p>开发环境:play freamwork1.2+postgresql9.4.8</p><p>【我的测试】</p><p>项目需要根据不同用户切换到不同schema下,切换也无非是对hibernate的session处理,这个部分没问题,接着我切换后执行新增。</p><p>代码如下:</p><pre name="code" class="java"> public static void adda() { Workeraa w = new Workeraa("a"); w.save(); a(); }
【我的思路】
我的数据库的schema的用户对数据库序列操作权限不足
【解决历程】
1、\ds 命令查看所有序列
du=> \ds 关联列表 架构模式 | 名称 | 型别 | 拥有者 ----------+--------------------+--------+---------- public | hibernate_sequence | 序列数 | postgres public | worker_id_seq | 序列数 | postgres(2 行记录)可以看到有两个序列,并且所有者是postgres管理员。
2、grant all on hibernate_sequence to myusername;给我创建的角色赋权
3、操作的时候,默认使用当前schema的序列。
1 0
- hibernate: could not get next sequence value
- could not get next sequence value
- could not get next sequence value
- could not get next sequence value
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not get next sequence value
- org.hibernate.exception.SQLGrammarException: could not get next sequence value
- Hibernate+oracle 报错could not get next sequence value
- org.hibernate.exception.SQLGrammarException: could not get next sequence value错误原因
- could not get next sequence value hibernate.hbm2ddl.auto=update hibernate.default_schema
- nested exception is org.hibernate.exception.SQLGrammarException: could not get next sequence value
- oracle数据库中could not get next sequence value的解决
- NHibernate could not get or update next value[SQL: ] 对象名 'hibernate_unique_key' 无效。
- could not get a field value by reflection getter of
- could not get wglGetExtensionsStringARB
- could not get wglGetExtensionsStringARB
- could not get wglGetExtensionsStringARB
- could not get wglGetExtensionsStringARB
- 使用awk拼接字段时部分中文乱码问题
- 培训班模块工作总结
- 特立独行的在输入法弹起的时候将指定控件往上推
- cocos2d-x IOS 和Android播放视频(包括网络视频)
- Makefile总结
- could not get next sequence value
- NSDate添加常用Category,用于得到是否是今天,昨天等
- 关于C++中的引用
- 迁移到Java8示例之filter
- 读书笔记数据科学入门————Python快速入门
- zmap安装实践
- Gson解析Json工具类
- spring4的定时任务
- 软件工程视频总结(二)