Skip to content

UnitOfWorkQueryValueHolder is not wrapped properly #2461

@dtaimanov

Description

@dtaimanov

See forum topic.

Steps:

  1. Download and run project: unfetch.zip
  2. Open Blank Screen
  3. Press upper button, then bottom button
    ER: No exceptions
    AR:
java.lang.IllegalStateException: Cannot get unfetched attribute [infoEntity] from detached object com.company.jmix_unfetch.entity.LastEntity-92a4bf42-6755-3b2a-c5ba-2badd96853f2 [detached].
	at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.throwUnfetchedAttributeException(UnitOfWorkValueHolder.java:326)
	at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:106)
	at com.company.jmix_unfetch.entity.LastEntity._persistence_get_infoEntity(LastEntity.java)
	at com.company.jmix_unfetch.entity.LastEntity.getInfoEntity(LastEntity.java:25)
	at com.company.jmix_unfetch.screen.blank.BlankScreen.onReadClick(BlankScreen.java:49)
	at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)

Cause:

UnitOfWorkQueryValueHolder is not wrapped for infoEntity property in deeply nested entity LastEntity, because it is already loaded despite absence in fetch plan.

see io.jmix.eclipselink.impl.lazyloading.JpaLazyLoadingListener#processValueHolders

Possible solutions:

a. Prevent excessive loading
b. Modify wrapping logic
c. leave as is if there are no "good" solutions

Metadata

Metadata

Assignees

Type

Projects

Status

Review

Relationships

None yet

Development

No branches or pull requests

Issue actions