|
|
|
Rank: Member
Groups: Member
Joined: 7/2/2009 Posts: 4 Points: 12
|
I am getting the following exception at the form level since I changed out from another database today to VistaDB. The code has been running for a couple of months and I was wondering if anyone else has experienced this.
overflow or underflow in arithmetic operation
after the exception I can stop the project and then restart. After a couple of attempts it will finally complete the database update. I am not using transactions.
I am using the VISTADB35-Build84.exe VistaDBConnection myMarkerCommand.ExecuteNonQuery(); VistaDBDataReader
Thanks Kent
|
|
|
|
Rank: VistaDB Staff
Groups: Administration, VistaDB Staff
Joined: 8/13/2006 Posts: 3,372 Points: 3,911 Location: Mount Dora, Florida
|
What is the SQL statement though? It sounds like you are overflowing the .Net datatypes to SQL Server ranges. SQL Server type ranges are not the same as .Net datatype ranges (or other databases). A common example is setting a DateTime column to DateTime.Max or DateTime.Min in .Net - you can't do that to a SQL DateTime column. The range is totally different. Same thing with some of the other types that have precision and scale (double, float, etc). .Net scale on those types are different than SQL Server scale. SQLite, for example,does no sql type range validation so you can go way out of bounds and it will never report the error. Jason Short
|
|
|
|
Rank: Member
Groups: Member
Joined: 7/2/2009 Posts: 4 Points: 12
|
Jason I captured the insert statement and pasted it into Data Builder and the insert works. If I clear the tables and then run the code again the problem occurs at a different insert statement, no on the same statement. None of my values exceed their types in the database. The error occurs if I am in a transaction or not. This is happening in an execute non query.
|
|
|
|
Rank: VistaDB Staff
Groups: Administration, VistaDB Staff
Joined: 8/13/2006 Posts: 3,372 Points: 3,911 Location: Mount Dora, Florida
|
Can you reproduce it? If it is something you can reproduce we can always take a look. Only happens within your app? Or does a sample just performing those actions also cause the same results? What is the call stack on the operation? Jason Short
|
|
|
|
Rank: Member
Groups: Member
Joined: 7/2/2009 Posts: 4 Points: 12
|
Here is what I am seeing. if I loop through another repository and send insert statements as I go using executeNonQuery, then after a period of time I will get the overflow or underflow condition. This does not occur in the same place each time. If I concatenate all of my insert statements into one string and execute that string all of the inserts take place without a problem. Tomorrow I will build you an application to demonstrate this. Thanks
|
|
|
|
Rank: VistaDB Staff
Groups: Administration, VistaDB Staff
Joined: 8/13/2006 Posts: 3,372 Points: 3,911 Location: Mount Dora, Florida
|
Any update on this? Even just a generalized flow of the code and we might be able to generate something. Jason Short
|
|
|
|
Rank: Member
Groups: Member
Joined: 7/2/2009 Posts: 4 Points: 12
|
I built a test project and the problem disappeared in the test, inserting the same data reading it from a txt file. I think the problem is in the debug hosting process in vs2005. If I run the complied version from outside of Visual Studio I do not get an error. If I run it within the environment in debug mode I generate the error. The error is in Vista DB when I execute the SQL. It is a very strange problem, It appears to be similar to a stack overflow or something which is not supposed to be able to happen in managed code except for a few resources that do not automatically release their references. For now I will assume it is in the VSHOST process and continue since I cannot duplicate this behavior in my test project. I really appreciate your timely responses, if at some point I can recreate this I will send you the code. Thanks for your help.
|
|
|
|
Rank: VistaDB Staff
Groups: Administration, VistaDB Staff
Joined: 8/13/2006 Posts: 3,372 Points: 3,911 Location: Mount Dora, Florida
|
Hmm, there are a couple other difference in .Net code running in a debugger. The GC behaves differently (it is not as agressive, and tends to leave things longer), and the diagnostic namespaces have a lot more things that are "live" within them. That would be an interesting test for us though. If you have the version that works without a debugger, but dies within it I would like to see it. We might be able to get an answer from Microsoft as to why and work around the issue in the debugger. Sometimes you can do things like force GC only when running under an attached debugger, etc. It is rare, but not unheard of. Jason Short
|
|
|
|
Guest
|
YAFPro Theme Created by Jaben Cargman (Tiny Gecko)Powered by YAF 1.9.3 |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.078 seconds.