-
Notifications
You must be signed in to change notification settings - Fork 934
Caching of Property Dialect in class Configuration.Mapping #1950
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
Comments
Have you checked there is still the issue with NHibernate v5.2? There have been some changes done on that precise subject. See #1703. |
Today i tried to upgrade our project to V5.2.1. That's the reason i have created this issue :-) |
In this case, switching to lazy will cause bugs if someone build a session factory from a configuration, then change the configuration's dialect (and connection string, obviously) and build a new session factory from it. (Or use other methods depending on that |
My solution is not (fully) correct. When the mapping was deserialized, the Property throws a Nullpointer Exception. |
Can i avoid the creation of the big subQuery instead? |
This is another subject. I think the dialect many instantiations in About the big sub-query trouble, it is likely a subject to be discussed first on the user groups (nhusers). It seems it is useless in your case (and likely not working if trying to execute it), so it should be checked if it can be avoided. That is a support subject, whereas the NHibernate GitHub issues are used for bug reports or feature requests. (It may conclude there would be a need for changes in NHibernate, in which case another issue will have to be opened, but it has first to be checked.) |
This Property should be cached, because the creation of Dialect can be expensive.
This is our scenario: We have a base class with a lot of subclasses (over 400).
The class
UnionSubclassEntityPersister
creates for our base class a very long (over 20 Million characters) SubQuery inGenerateSubquery
.Everytime
GetSqlTypeCode
is called for an instance ofNullableType
the Dialect will be created again.This is a possible solution for the problem.
The text was updated successfully, but these errors were encountered: