`
stta04
  • 浏览: 114817 次
  • 性别: Icon_minigender_2
  • 来自: 广州
社区版块
存档分类
最新评论

No row with the given identifier exists

阅读更多
在为已建的表添加一个字段,因为我要用一个自动脚本工具生成bean类,hibernate和ibatis的相关配置文件,所以按以往的做法把表删掉然后用重建表。
最后JBPM的实例表,变量表与该文档绑定了ID导致如下面类似的错误:
Hibernate:No row with the given identifier exists

ObjectNotFoundException: No row with the given identifier exists

Where it can occur:

This might occur if you try to load a non-proxied object with session.load() or you load a proxied object and later access the proxy. It may also occur when loading mapped collections which are not eagerly fetched.

What it means:

This means just what it says - Hibernate expected to have a row with a certain id in the database, and did however not find it.

How it can be caused:

Wrong id for load

If you are using a nonexistant id for a load(), you will get this exception. Note that if you are using proxies, this may occur later on, when the proxy is first "broken".

Broken foreign key relationships

If you map for example a many-to-one relationship, and the table containing the objects on the "many" side contains a foreign key to a non-existant row of the "one" side table, you will get such an exception. This will only happen if the collection is not fetched eagerly.

Reusing a session across multiple transactions

The hibernate session internally memorizes some state. For example it internally stores ids which it assumes are already deleted from the database. So if you make the session believe somehow an object with a certain id has been deleted, and later try to load it again, you will get this exception without Hibernate even trying to access the database. So be careful with that.

How it can be fixed:

  • Check the ids you are using for load
  • Validate your foreign key relationships - the database should already maintain such integrity constraints.
  • Beware of multiple transactions within a single session. Try to stick to "one session, one transaction" rule. Especially do not reuse sessions after an HibernateException.

也就是是说关系数据库一致性遭到了破坏,找到相关表,就可以解决了。

分享到:
评论

相关推荐

    精心整理的ssh2 一些错误问题的记录(推荐)

    ### 错误七:No row with the given identifier exists 这意味着根据提供的标识符查询数据库时,没有找到任何行。检查SQL查询和标识符是否正确,以及数据库中是否存在预期的数据。 ### 错误八:No result defined ...

    项目异常汇总

    #### 七、No Row with the given identifier exists **异常描述:** 操作数据库时,尝试访问不存在的数据行。 **异常信息:** 错误提示通常会明确指出所查找的数据行不存在。 **异常原因:** 数据库中不存在指定...

    no resource

    很抱歉,但根据提供的信息,标题"no resource"和描述"fe ge 2007 programe"没有明确指出任何具体的IT知识点。标签同样显示为"no resource",也没有提供额外的线索。压缩包子文件的文件名称列表包括:飞鸽传书升级...

    apktool_AndResGuard:修复apktool打包出现No resource found...

    No resource found that matches the given name..... ....... 使用apktool-2.0.3也可以回编译,但是比如微信回编译后会增加到110M左右,很不友好。 而使用apktool-2.3.2和原包大小一样,65M左右。 基于apktool

    不常用的TParser类解析(文本文件中相关字符串)

    Raises an EParserError exception with the given message procedure ErrorFmt(); Raises an EParserError exception and formats the message. procedure ErrorStr(); Raises an EParserError exception with ...

    微软内部资料-SQL性能优化5

    If there is no clustered index, there is a sysindexes row for the table with an indid value of 0, and that row will keep track of the address of the first IAM for the table. The IAM is a giant bitmap...

    windows程序设计

    created with the default settings in Microsoft Visual C++ 6 with one major exception: aside from other compiler and linker flags, the executable in the DEBUG directory has been compiled with the ...

    The Digital Object Identifier initiative: metadata implications

    数字对象标识符(Digital Object Identifier,简称DOI)是一种持久性标识符,用于唯一地标识数字资源,如学术文章、数据集等。DOI系统由国际DOI基金会管理,并在出版界广泛采用。随着数字资源的增加以及对资源描述的...

    servlet2.4doc

    Returns the value of the named attribute as an Object, or null if no attribute of the given name exists. getAttribute(String) - Method in interface javax.servlet.http.HttpSession Returns the object ...

    计算机网络第六版答案

    14. If the two ISPs do not peer with each other, then when they send traffic to each other they have to send the traffic through a provider ISP (intermediary), to which they have to pay for carrying ...

    SMS with the SMS PDU-mode

    - **PID协议标识(Protocol-Identifier)**:用于识别消息所遵循的协议。 - **DCS数据编码方案(Data Coding-Scheme)**:指定消息的编码方式。 - **VP信息有效期(Validity Period)**:定义了消息的有效期。 - **...

    hibernate错误汇总

    错误八:Exception in thread "main" org.hibernate.HibernateException: More than one row with the given identifier was found: 1, for class: org.model.User 错误原因:这个错误表示在尝试获取主键为1的实体...

    developing android application with adobe air.part3.rar

    Chapter 1 : AIR Installing the Adobe Development Tools Installing the AIR Runtime on an Android Device What Is in the AIR SDK New ActionScript Libraries AIR on the Desktop Versus AIR on Android Mobile...

    硬件精灵Unknown Device Identifier

    "硬件精灵Unknown Device Identifier"是一款专门用于识别和解决电脑中未知设备问题的工具软件。它在IT领域中扮演着重要角色,特别是在系统维护和硬件升级过程中。未知设备是指操作系统无法正确识别或驱动程序缺失的...

    微软内部资料-SQL性能优化3

    RID A Row Identifier. Used to individually lock a single row within a table. Application A lock resource defined by an application. The lock manager knows nothing about the resource format. It simply...

    PC-IDENTIFIER-09.03.03.00-01.04.00.03安装包-链接地址.txt

    标题和描述中提到的"PC-IDENTIFIER-**.**.**.**-**.**.**.**安装包-链接地址.txt"和"PC_IDENTIFIER_**.**.**.**_**.**.**.**安装包_链接地址"是文件的名称和描述,它们所指的知识点是关于一个特定版本的软件或插件的...

    hibernate常见异常

    a different object with the same identifier value was already associated with the session 是一种常见的异常,通常是由于在 Hibernate 中同一个 session 里面有了两个相同标识但是是不同实体所致。解决方案有...

    C++编程中__if_exists与__if_not_exists语句的用法

    __if_exists ( identifier ) { statements }; 参数 参数 说明 identifier 要测试其存在性的标识符。 statements identifier 存在时要执行的一个或多个语句。 备注 若要实现最可靠的结果,请在以下约束...

    CPU-Identifier, 检查你的A9芯片制造商.zip

    CPU-Identifier, 检查你的A9芯片制造商 CPU标识符这个小应用程序可以检测你的iPhone的CPU芯片组。 对于 iPhone/6s,它还可以检测到A9芯片的制造商。编译的( 签名) 二进制文件将把芯片模型。设备模型和一个惟一 id ( ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: After deleting the selected points in the TFlexPanel.DeleteSelectedPoints the all figures with one point also deleted. - FIX: When the curve contain more then one figure and they were all ...

Global site tag (gtag.js) - Google Analytics