ECLIPSELINK-00195 With Embeddeds Even With eclipselink.cache.shared.default Is False (Doc ID 1093720.1)

Last updated on JULY 29, 2017

Applies to:

Oracle TopLink - Version 11.1.1.2.0 and later
Information in this document applies to any platform.

Symptoms

JPA Embeddeds are always set to shared=true (isolated=false) and do not pick up defaults or their parent's shared setting. They should probably inherit the isolation of their parent at all times. When eclipselink.cache.shared.default is set to false, any relationship from an Embedded to a non-shared Entity will trigger a validation exception.

Entity Object Model

Publisher references Embeddable Address
Address has a OneToOne mapping to City

The persistence.xml defines:

<property name="eclipselink.cache.shared.default" value="false" /> 

Problem Scenario


Observed Behavior

Exception [EclipseLink-195] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DescriptorException

Exception [EclipseLink-0] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.IntegrityException

Descriptor Exceptions:
---------------------------------------------------------
Exception [EclipseLink-195] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DescriptorException

Exception Description: The shared class model.Address must not reference the isolated class model.City.
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[city]
Descriptor: RelationalDescriptor(model.Address --> [DatabaseTable(PUBLISHER)])

Changes

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms