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

Property convention does not apply precision #527

Closed
kriewall opened this issue Feb 19, 2022 · 1 comment
Closed

Property convention does not apply precision #527

kriewall opened this issue Feb 19, 2022 · 1 comment

Comments

@kriewall
Copy link

What is the current bug behavior?

I have defined the following property convention with the intent of limiting the precision of all double values to 15 as written to an Oracle dB:

    public class PrecisionConvention : IPropertyConvention
    {
        public void Apply(IPropertyInstance instance)
        {
            if (instance.Type == typeof(double)) instance.Precision(15);
        }
    }

I have a value with exceedingly high precision for a Percentage class being written to the dB. I can see that the precision is being updated for my Percentage class by PrecisionConvention; however, when the value is written to the dB, it is done so at its unmodified precision.

image
image

What is the expected correct behavior?

Setting the precision via an implementation of IPropertyConvention should be reflected in the database.

image

Impact

The inability to limit the precision when writing to the dB is causing the Oracle client to bomb out - there's a known issue with Oracle where doubles may be written to the dB in higher precision than can be represented by C# (I reported this issue long ago to them but still have yet to see a fix), so I need a way to limit the precision for all doubles before write. I'd like to request either a fix or a recommendation for a workaround.

@hazzik
Copy link
Member

hazzik commented Oct 12, 2022

Schema update does not currently update the precision of columns if the [base] type is the same. So, this is a
Duplicate of nhibernate/nhibernate-core#1895 (comment)

@hazzik hazzik closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2022
@hazzik hazzik marked this as a duplicate of nhibernate/nhibernate-core#1895 Oct 12, 2022
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