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

Load should return objects from unit of work #59

Closed
tim-cools opened this issue Nov 9, 2015 · 3 comments
Closed

Load should return objects from unit of work #59

tim-cools opened this issue Nov 9, 2015 · 3 comments

Comments

@tim-cools
Copy link
Contributor

Scenario:

  • session.Store(student.id = 1)
  • session.Load(1) returns null
    (SaveChanges not called yet)

I expect that the second call returns the object stored by the first call from a cache. What do you think?

@jeremydmiller
Copy link
Member

@tim-cools That probably needs to be part of a larger Identity Map feature. I've gone back and forth on whether or not we should do that underneath DocumentSession.

I can be convinced either way. I can think of a scenario or two within the system at work we're building Marten for that could use it.

@tim-cools
Copy link
Contributor Author

I agree that it normally doesn't happen. But I'm creating an implementation of http://www.asp.net/identity backed-up by PG and I face this situation when I plug in the library for storage.

I also think you need an Identity map to detect dirty objects when doing a SaveChanges to the store if you want to support automatically updates like ravendb and the orm's does.

@jeremydmiller
Copy link
Member

Done, but there's a separate issue for Select()

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

No branches or pull requests

2 participants