Welcome Guest Search | Active Topics | Log In | Register

overflow or underflow in arithmetic operation Options
kdavis100
#1 Posted : Thursday, July 02, 2009 3:17:24 PM
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
js_vistadb
#2 Posted : Thursday, July 02, 2009 3:43:00 PM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,387
Points: 3,946
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

kdavis100
#3 Posted : Thursday, July 02, 2009 4:28:25 PM
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.
js_vistadb
#4 Posted : Thursday, July 02, 2009 4:43:18 PM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,387
Points: 3,946
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

kdavis100
#5 Posted : Thursday, July 02, 2009 5:18:14 PM
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
js_vistadb
#6 Posted : Monday, July 06, 2009 1:50:27 PM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,387
Points: 3,946
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

kdavis100
#7 Posted : Monday, July 06, 2009 2:00:54 PM
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.
js_vistadb
#8 Posted : Monday, July 06, 2009 2:10:54 PM
Rank: VistaDB Staff

Groups: Administration, VistaDB Staff

Joined: 8/13/2006
Posts: 3,387
Points: 3,946
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

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.072 seconds.