Skip to content

Eagerly fetch Domain and DomainHistory nsHosts - #3261

Open
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:eagerDomainCollections
Open

gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:eagerDomainCollections

Conversation

@gbrodman

@gbrodman gbrodman commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Configure @ElementCollection(fetch = FetchType.EAGER) on Domain.getNsHosts() and DomainHistory.nsHosts, and remove the manual Hibernate.initialize() calls in Domain.postLoad() and DomainHistory.domainHistoryPostLoad() (b/188044616).

Way back when, DomainBase::setNsHosts called forceEmptyToNull() on uninitialized PersistentSet instances if we tried to use FetchType.EAGER. Now that we preserve PersistentSet instances when setting nsHosts and all child collections in Domain* are FetchType.EAGER, they get automatically initialized before detaching.


This change is Reviewable

Configure @ElementCollection(fetch = FetchType.EAGER) on Domain.getNsHosts() and DomainHistory.nsHosts, and remove the manual Hibernate.initialize() calls in Domain.postLoad() and DomainHistory.domainHistoryPostLoad() (b/188044616).

Way back when, DomainBase::setNsHosts called forceEmptyToNull() on
uninitialized PersistentSet instances if we tried to use
FetchType.EAGER. Now that we preserve PersistentSet instances when
setting nsHosts and all child collections in Domain* are
FetchType.EAGER, they get automatically initialized before detaching.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant