Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate only wrapping some mutable fields when accessed #466

Open
andyjefferson opened this issue May 1, 2022 · 1 comment
Open

Comments

@andyjefferson
Copy link
Member

The wrapping of mutable fields is performed in several places in the codebase. Whilst we absolutely need to wrap any field before handing it to the user (when managed by a StateManager), if we are simply querying for objects and loading fields we don't necessarily need to wrap them at that point since the field may not be accessed before detaching for example.
Consider other use-cases and only wrap fields when required.

@andyjefferson
Copy link
Member Author

The typical use-case is a query retrieves a field value. If the field is enhanced as a normal access (as opposed to getViaCheck or getMediate) then isLoaded() will not be called allowing interception of the value, so the value has to be in a wrapped state at that point.

What could be possible is to allow marking a transaction as read-only and in that case anything returned to the user could be returned unwrapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant