Have you tried this with latest build of JetDriver? I'll take a closer look
on your patch and integrate if that fixes the problem you mentioned. By the
way, current test suite uses an actual Jet database to run an automated test
so writing one would be pretty simple.

Thanks for reporting this and sending in the patch.

On Mon, Mar 21, 2011 at 7:12 PM, Kristoffer Jansson <
[email protected]> wrote:

> I ran into a problem with the JetDriver and decimals a while ago when
> working with MS Access databases, but I have no idea how to
> contribute, so I'll just post it here.
>
> The problem arises when you're trying to save a value of type decimal
> in the database. Regardless of whether the designated column is a
> double, or an actual decimal doesn't seem to matter. What happens is
> that the decimal separator magically disappears. So saving '1.2' would
> result in the value '12' in the database.
>
> The fix is making decimals into doubles before saving to database.
> Similar as to how the code already makes Int64 into Int32. This works
> on both double and decimal columns.
>
> I've no idea how to write an automated test to verify this, except
> actually having a database lying around and try to store and read back
> the data. Even then I'm not sure if the test could be used safely as
> it's not very isolated. There may be some twisted environment of
> drivers etc where the error wouldn't show up.
>
> Anyway, I've seen this exact behavior on our systems as well as
> customers, so it doesn't seem like it's only me :)
>
> Here's a patch that fixes the problem:
> http://www.itstod.se/files/jetdriver_decimal_to_double_fix.patch
>
> --
> You received this message because you are subscribed to the Google Groups
> "NHibernate Contrib - Development Group" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhcdevs?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"NHibernate Contrib - Development Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhcdevs?hl=en.

Reply via email to