Decimal Issues

I have a line Item Table with the following fields:

Item_Qty (Number)
Item_Cost (Number)
Item_Total (Number) (Stored Calc = Item_Qty * Item_Cost)

I also have an aggregate field (Item_Cost_Sum)

In my Orders table I have the folowing field;

Order_Total (Number) (Stored Calc = orders_to_lineitems.Item_Cost_Sum)

Seems pretty standard.

I have just realized that I can ony enter whole numbers or #.5, if I try any other decimal .7, .2, .9 I get the following error:

java.lang.ArrayIndexOutOfBoundsException null

I have looked at the backend datatypes servoy created them as “float”.

There must be something I am missing?

Thanks,
Erich

Here is a copy of the SQL File Error:

2006-01-25 11:14:12.34 spid52 Error: 17805, Severity: 20, State: 3
2006-01-25 11:14:12.34 spid52 Invalid buffer received from client..

Thanks for any help with this.

Erich

Here is my Java Web Client Trace:

tarting Servoy from C:\Documents and Settings\TEMP\Desktop
Servoy R2 2.2.3 build-335 on Windows 2003 using Java 1.5.0_06
getWebStartURL http://localhost:8080/
getWebStartURL http://localhost:8080/
getWebStartURL http://localhost:8080/
com.servoy.j2db.persistence.RepositoryException: java.lang.ArrayIndexOutOfBoundsException null
com.servoy.j2db.persistence.RepositoryException: java.lang.ArrayIndexOutOfBoundsException null
at com.servoy.j2db.dataprocessing.SQLEngine.performUpdates(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine_Stub.performUpdates(Unknown Source)
at com.servoy.j2db.dataprocessing.ay.a(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.updateRecord(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.stopEditing(Unknown Source)
at com.servoy.j2db.dataprocessing.ap.if(Unknown Source)
at com.servoy.j2db.dataprocessing.ap.stopEditing(Unknown Source)
at com.servoy.j2db.FormPanel.saveData(Unknown Source)
at com.servoy.j2db.p.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Well, I found the issue;

If I try to try to enter Item_Cost or Item_Qty with a decimal other then .5 , I get the error, and the data is not saved to the back end.

if I disable the calculation :

Item_Total (Number) (Stored Calc = Item_Qty * Item_Cost).

I can enter any demial, and the data is saved successfully.

I am not sure if the aggregate sum of the Item_Total may be cause in issue either.

I would not think that this would be the expected behavior, I would think this is a common scenario.

I have hit a wall, as I have allot of forms and calculations based on these fields.

Thanks Again for any input.

Erich

Could anyone please let me know if this is expected behavior when entering decimals into fields that are used in calculations & aggregates? I could create a small sample soultion if needed.

Thanks,
Erich

I was having a same kind of problem (not exactly the same) and reported it to Johan.
It seems so be a bug in the Sybase driver.
Johan could work aroun it and fixed it in the following version! (2.2.4)

It only appears when you use Sybase!

Thank you so much for responding.
I am using ASA as repository and SQL 2000 for backend. Is 2.2.4 available yet?

Than I don’t think it is the same issue!

send your problem (with sample - solution) and explanation to: support@servoy.com

Well, I created the sample solution, and everything worked fine. There must be some sort of reationship conflict somewhere. Its definatly a relationship issue.

Thanks for the help