Lazy loading is not triggered in front-end, though static weaving is enabled [message #1707424] |
Fri, 04 September 2015 15:34 |
Stijn Hooft Messages: 2 Registered: September 2015 |
Junior Member |
|
|
Hi,
When an entity has been passed to the front-end, and becomes detached, normally you cannot retrieve an unitialized, lazy-loaded list. Though, EclipseLink does support this feature, thanks to it's weaving.
We've used this feature heavily in our application, which was deployed on Weblogic.
Now, we are making the switch to JBoss EAP 6.3. Initializing uninitialized lists on detached entities no longer seem to work.
We've activated static weaving. (added the property in persistence.xml + added a maven plugin to do the weaving at compile time).
This seems to work fine.
When we start debugging, we see the following happen. The code here is the decompiled result after weaving:
Entity Organzation has a lazy-loaded list locations.
We call, on a detached Organization, the method getLocations():
@OneToMany(cascade={CascadeType.ALL}, mappedBy="organization")
public List<OrganizationLocation> getLocations() {
return this._persistence_get_locations();
}
Organization => _persistence_get_locations()
public List _persistence_get_locations() {
this._persistence_checkFetched("locations");
return this.locations;
}
AbstractDomainClass =>_persistence_check_fetched("locations")
public void _persistence_checkFetched(String string) {
if (!this._persistence_isAttributeFetched(string)) {
EntityManagerImpl.processUnfetchedAttribute((FetchGroupTracker)this, (String)string);
}
}
AbstractDomainClass => _persistence_isAttributeFetched("locations")
public boolean _persistence_isAttributeFetched(String string) {
return this._persistence_fetchGroup == null || this._persistence_fetchGroup.containsAttributeInternal(string);
}
Organization =>_persistence_fetchGroup == null is TRUE
AbstractDomainClass. _persistence_isAttributeFetched("locations") is TRUE
So nothing gets loaded!
Does anyone have any idea why _persistence_fetchGroup could be null? We don't have any fetchGroups specified, but it should have a default one, no?
We've tested this with EclipseLink 2.5.1, 2.5.2 and 2.6.0.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03305 seconds