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

[3.1] Cache Question #235

Closed
zpqrtbnk opened this issue Mar 9, 2016 · 13 comments
Closed

[3.1] Cache Question #235

zpqrtbnk opened this issue Mar 9, 2016 · 13 comments

Comments

@zpqrtbnk
Copy link
Contributor

zpqrtbnk commented Mar 9, 2016

Hey,

It has to be obvious but I cannot understand it.

The MemberAccessor class creates get/set delegates. That happens when a PocoDataBuilder is initialized. Which seems to happen anytime a PocoDataFactory has to return a PocoData for a type for the first time. And each Database, when created, seems to create and own it own PocoDataFactory.

Which would mean that each Database instance ends up creating a data factory, builders, the get/set delegates, etc. Which sounds... bad.

What am I missing? ;-)

S.

@kersane
Copy link

kersane commented Mar 10, 2016

@zpqrtbnk nice catch :), i just playing with NPoco to understand its internal mechanism, IMHO v3.1 introduce a lot of broken changes in its internal structure. I agree with you about PocoData that should be statically cached, but this behavior is intentionally changed since v2.11.10, any reason @schotime ?. There are also inconsistent behavior about using Attributes and FluentMapping especially for reference. Indeed v3.1 offer flexibility over mapping plan that is awesome in my opinion, but i think there are a lot of things that need to be clarified about those changes.

@zpqrtbnk
Copy link
Contributor Author

Into PR mode ;-)

@schotime
Copy link
Owner

Hey guys,

There is indeed a caching issue that I'm working through at the moment.
It's quite complex so I'm trying to plan in out.

The pocodata's are rebuilt on each query now as they may need to mutate per
query, however they are very cheap to build. This is done to enable certain
scenarios with the linq queries.

Thanks for the feedback
Adam
On 10 Mar 2016 9:27 pm, "Stephan" [email protected] wrote:

Into PR mode ;-)


Reply to this email directly or view it on GitHub
#235 (comment).

@zpqrtbnk
Copy link
Contributor Author

As I go through the code and try to understand and check changes vs v2, might submit PRs that mostly add comments, to begin with - if that's OK with you?

@kersane
Copy link

kersane commented Mar 10, 2016

It is indeed quite complex :D, but i think once you traverse all member and built PocoData metadata is enough to support most query scenario, (except for dynamic, which need to be evaluated each run) or maybe i missed some scenario? My idea is moving PocoDataFactory outside the Database lifecycle and injected into database for mapping plan, therefore you can maintain static cache for typed poco, but im not sure if it is suitable for dynamic property.

@schotime
Copy link
Owner

schotime commented Mar 10, 2016 via email

@kersane
Copy link

kersane commented Mar 10, 2016

@schotime about fluent mapping, have you read my comment #232 (comment) ?

@schotime
Copy link
Owner

@dwirawan I have, and its on my list to have a look at tomorrow after I sort the caching out ;)

@kersane
Copy link

kersane commented Mar 10, 2016

@schotime thanks, maybe i will start some contribution for small patch, since i am not familiar with git, so pardon me for some PR mistake ;)

@schotime
Copy link
Owner

@dwirawan Even if you can figure out the problem and can send me the snippet that fixes and a test or post it in the issue then I can always patch it from there ;)

@schotime
Copy link
Owner

Just committed up new changes and merged your other PR @zpqrtbnk

@schotime
Copy link
Owner

This one fixed now? Can i close?

@zpqrtbnk
Copy link
Contributor Author

From what I've seen, using the new fluent factory et al, my original question is solved. Thanks!
Closing.

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

3 participants