This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I need to store values of type Double, where some of them are NANs or INFs. Unfortunately Lightspeed crashes with NAN values with the message: "(Entity).DoubleProperty may not be NULL." I didn't check it with pure SQLite (without Lightspeed), however they claim they support both: http://www.sqlite.org/cvstrac/tktview?tn=3060. I didn't check NAN storage with other DB providers, either. I attach a test project - please look at the test: "DoublescanstoreNanandInfValues". We are still using Lightspeed 4. |
|
|
Unfortunately this is a SQLite issue. Its unclear if its the actual engine or the ADO.NET provider which is at fault but this is reproducible by issuing a simple insert/update statement passing a Double.NaN parameter via the ADO.NET provider. The provider guys seem to point to a change in the engine FWIW - see: http://sqlite.phxsoftware.com/forums/p/878/3765.aspx, so Im afraid we cant do anything about this unless its fixed in a later provider/engine update.
|
|
|
I posted a ticket to guys of System.Data.SQLite: http://system.data.sqlite.org/index.html/tktview/e06c4caff3c433c80616ae5c6df63fc830825e59. I'm awaiting their response. |
|
|
The SQLite guys made an amendment, however not the way I expected. Please take a look at the solution and let me know if it could help with the NaN problem. |
|
|
That looks promising, particularly given 1.0.85 should be available soon. Ill keep an eye out for the update and we can recheck then to see how this is handled. Im due to update the provider so we can look at updating that in the nightlies when it becomes available.
|
|
|
Hi Jeremy, I've checked it today, and it looks like System.Data.SQLite is available in version 1.0.86 now. Could you check if this version solves the NAN problem, please? Will there be any performance impact when using "BindAllAsText"? Darek Wąsacz, InstalSoft |
|
|
Will do. Ill update the provider tomorrow and post an update after this.
|
|
|
Ive restested this against 1.0.86 and the test does indeed now pass after the following connection string syntax
In terms of the performance cost of using this flag, I did a quick test for fetching 100000 EntA's with the flag on/off. Running with the flag on is more expensive but over that many calls it was less than 1% of the overall time so the cost does seem minimal. The provider will be updated in tonights nightly build.
|
|
|
Hi Jeremy, I tried to use the new flag, but it doesn't work. I get an exception: Mindscape.LightSpeed.LightSpeedException : Unable to materialize field [DoubleProperty] on type [Mindscape.LightSpeed.Tests.LSModel.EntA]. Check your table has an Id column and that your mappings are correct. See inner exception for details. ----> System.FormatException : Input string was not in a correct format. I attach my test library, as usual. Darek Wąsacz, InstalSoft |
|
|
Hi Darek, Which one is the failing test? I am getting 13 passed, 2 skipped when running this. The skipped tests dont appear to relate to this problem although I did try InsertNanusingADONET but that is also passing.
|
|
|
The failing test is: DoublescanstoreNanandInfValues. I've run it against 20130606 nightly. Darek Wąsacz, InstalSoft |
|
|
Hmm thats odd, Ive re-run it here but its still passing for me Im afraid.
|
|
|
Maybe it is somehow dependent on regional settings? My regional settings are Polish, so i.e. double.PositiveInfinity.ToString() doesn't return "Infinity", but its translated form. The test fails while trying to read entity with positive infinity (line: var entA1 = uow.EntAs.First(e => e.EntityProperty1 == "PositiveInfinity"); ). It doesn't fail on inserting values into database. So it is possible that Lightspeed correctly uses CultureInfo.InvariantCulture while storing values and incorrectly CurrentCulture while reading/parsing values. Darek Wąsacz, InstalSoft |
|
|
Yes that sounds like a reasonable hypothesis! Ill set up a test here and see if I can reproduce this.
|
|
|
Hi Jeremy, Is there any news in this subject? Darek Wąsacz, InstalSoft |
|
|
Hi Darek, Sorry no update. I have not had time yet to be able to set up a test for this. Im hoping to have some time to look at this next week.
|
|
|
Hi Jeremy, I have temporarily changed regional settings to English and the tests pass. I understand that you have no time to set up a test, but I kindly ask you to temporarily change regional settings and see if you can make a quick fix for this problem. I'm blocked with my work because of this bug :-( Darek Wąsacz, InstalSoft |
|
|
Ive been able to reproduce this and I have added a fix which will be available in the next nightly build for you. Let us know if you encounter any other issues.
|
|
|
Great news! Unfortunately something is wrong with the nightly build of Lightspeed 5. While writing this post (2013-06-28, 13:43 GMT) there's still nightly build from June 24th. Darek Wąsacz, InstalSoft |
|
|
I've downloaded 20130629 nightly and it works great! Case is closed. Thank you very much for your support! Darek Wąsacz, InstalSoft |
|