id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	due_date
52	做旧清理数据时,表关联的数据被删 EntityNotFoundException 问题	huangjianhua		"出现的问题:
访问IT商城商品详细页面时报的异常信息如下:

{{{
javax.el.ELException: openjpa-1.2.0-r422266:683325 nonfatal store error org.apache.openjpa.persistence.EntityNotFoundException: 
The instance of type ""class cn.com.pconline.enterprise.domain.CompanyProduct"" with oid ""cn.com.pconline.enterprise.domain.CompanyProduct-9942580"" 
no longer exists in the data store.  This may mean that you deleted the instance in a separate transaction, but this context still has a cached version.

FailedObject: cn.com.pconline.enterprise.domain.CompanyProduct-cn.com.pconline.enterprise.domain.CompanyProduct-9942580
}}}

异常的主要信息是说访问商品号为9942580的时候,找不到关联的实体,抛出异常:EntityNotFoundException.

经过查找之后,发现是CompanyProduct 这个实体关联的表:ENT_PRODUCT_DETAIL 里面的数据在做数据清理的时候不小心被删除了,访问的时候找不到关联的实体,因此出了问题.

现在将数据恢复过来就正常了.

"	QA	closed	minor		系统相关	5.0	fixed			08/12/2011
