-
Notifications
You must be signed in to change notification settings - Fork 933
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
Wrap mapping usages in StaticDialectMappingWrapper in Configuration class #3399
Conversation
It could target 5.2.x in my opinion. According to NuGet stats, it still has some significant usage. 5.1.x is not so far below, but targeting it would require to back-port #2011 to v5.1.x. It should at least target 5.3.x. Aggregated by minor versions, the NuGet download stats for last six weeks are:
|
@@ -941,11 +945,12 @@ public string[] GenerateSchemaCreationScript(Dialect.Dialect dialect) | |||
|
|||
var script = new List<string>(); | |||
|
|||
var staticDialectMapping = new StaticDialectMappingWrapper(mapping, dialect); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would potentially need to do same as in BuildSessionFactory
if you want to leave mapping
field in place: replace mapping
field with wrapped instance and back when operation finished, otherwise something can access the unwrapped mapping
field and then have different dialect than was configured.
Even if there are no places that would be affected now - this could be in the future.
This is the reason I've decided to remove mapping
field altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a fix of previous versions, it is good enough for me.
7cabf16
to
3118666
Compare
Ok. Done |
3118666
to
40779f9
Compare
19673e7
to
e3e7786
Compare
IMO, 5.2 is too old. The issue is too minor and affects only schema generation which usually happens only on a startup of the application. |
5.2 also requires fixing the following errors:
So 5.3. then? |
Ok then, 5.3.x |
Fixes #3397
This is version of fix with minimal changes and impact specific for released branches. (as hazzik works on more general fix for master) I think it's worth fixing at least in 5.4 (as seems reported issue is 5.0 regression)