-
Notifications
You must be signed in to change notification settings - Fork 932
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
ISession.Refresh does not update lazy properties #3622
Comments
Hello again, I found out that if I always inject a new interceptor in the method PocoEntityTuplizer.AfterInitialize, my test runs through.
Best regards, |
Hi, i have created a draft patch file, which should fix the problem. The problem is, that i am using some obsolete methods... Bugfix_Issue_3622.patch Best regards, |
After looking at the patch, instead of creating a new issue, I think it is appropriate for me to add on here that I don't believe this is isolated to lazy properties or stateful sessions. I think the Refresh method is just broke for both ISession and IStatelessSession. This simple test case fails on the last line as the entity value is still 1:
I've debugged it down through almost the exact same code path as the above patch. It appears Loader.cs is issuing the query to the db, but then it get snagged in the GetRow method as its key being already loaded, thus bypassing binding/hydration. Great job on adding a patch @ValResnick ! EDIT: NH 5.5.2 / Fluent NH 3.4.0 EDIT 2: My mistake, the async version of Refresh appears to be having the same behavior. |
Hi,
we have noticed a problem in versions 4.4.9 and 5.5.2. In version 5.2.1 we did not have this problem, I suspect it is related to the lazy property changes in version 5.3 (116398d).
The following scenario:
We have opened a session with objects and also open another session and edit an object there, which is already loaded in the first session. We call Refresh so that this object is up-to-date in the previous session. Unfortunately, in the versions above, the lazy properties are no longer updated, but contain the previous and therefore old value.
Reproduction:
Best regards,
Thomas
The text was updated successfully, but these errors were encountered: