mirror of
https://github.com/google/nomulus.git
synced 2025-06-19 02:44:45 +02:00
* Always detach entities during load The mutations on non-transient fields that we do in some of the PostLoad methods have been causing the objects to be marked as "dirty", and hibernate has been quietly persisting them during transaction commit. By detaching the entities on load, we avoid any possibility of this, which works in our case because we treat all of our model objects as immutable during normal use. There is another mixed blessing to this: lazy loading won't work on these objects once they are detached from a session, meaning that all fields must be lazy loaded up front. This is unfortunate in that we don't always need those lazy-loaded fields and there is a performance cost to loading them, but it is also useful in that objects will now be complete when used outseide of the transaction that loaded them (prior to this, an attempt to access a lazy-loaded field after its transaction closed would have caused an error at runtime). * Changes requested in review * A few improvements to test logic * Deal with premature detachment of mutated objects * Add unit tests, use a more specific exception * Changes for review - Deal with DomainDeleteFlow, which appears to be the only case in the codebase where we're doing a load-after-save. - Display the object that is being loaded after save in the exception message. - Add a TODO for figuring out why Eager loads aren't working as expected. * Move the recurring billing event into a parameter * Changes for review and rebase error fix * Remove initialization of list entries Remove initialization of list entries that we want to be lazy loaded (premium, reserved, and claims lists). * Post-rebase cleanups |
||
---|---|---|
.. | ||
gradle/dependency-locks | ||
src | ||
WEB-INF/appengine-generated | ||
build.gradle | ||
Dockerfile |