Unstored calcs not rendering until I click on them

I’m having a strange problem with unstored calcs in Table Views not rendering in Smart Clients. Here is the environment:

Server:
Mac OSX 10.8.5
Java 7 update 65
Servoy 7.4.1

Clients:
Smart Client on any Mac or Windows machine running Java 7 update 60 or greater

Database:
Sybase SQL Anywhere v 16

Problem:
Calcs in table views are not showing up all the time. Some are, but most aren’t. But when I click on a field that is based on a calc, then the correct value shows up but only for that field (i.e. only for that row & column of the table view).

[EDIT]There is nothing fancy about these calcs. Here’s an example of one that’s not rendering:

function clc_clock_offset()
{
	return Math.round((creation_date - clock_time)/1000);
}

[end of EDIT]

I think this may have started when we upgraded the server to Java 7 update 65. These calcs were working fine before that. I’m not aware of any major changes in my code that could have caused this. Does anyone know what might be causing this? Thanks!

the question is is it more a paint issue or not.

So is the calc really calculated yes or no?
If you print an application.output for that cal with the record/row info, then if you render the table view do you see it being hit for all rows or not.
And if you click in it (when you suddenly see it) do you see the calc then really executed? Or does it then already show an already calculated value.

I put an application.output in several of the calcs that appear on the form.

When the table view is first shown, only the calcs that rendered print their output. Then each time I click on a calc that failed to render, that calc renders and prints its output. If I click on some non-calc field, the row becomes selected but the missing calcs do not render.

I downgraded the server to Java 7 update 60 but that didn’t change anything.

I’m now running some validations in Sybase Central to see if it finds any problems with the db itself. I’ll keep you posted on the results. Please let me know if you have any ideas. Thanks.

wat do you mean “calcs that render” do print there output
do you mean that you see rows that also should show the calc but those don’t render and don’t calculate?

That’s correct.

See the screenshot below. The columns I’ve marked as Calc should have values in all rows but as you they don’t always.

[attachment=0]calc_problem.JPG[/attachment]

As you suggested, I put application.output() in each calc. When the form first appears, I get application.output from only the calcs that rendered. Then if I click on a blank cell, it renders (just that cell, no others) and I get application.output from only that calc.

I have eliminated database corruption as a cause of this. I’ve also monitored memory usage in the Smart Client using the ‘About Servoy’ dialog and it looks fine. Also know that this problem is NOT happening in the web client.

I’ve used the Profiler to see if anything crazy is happening with my code and I don’t see anything unusual.

The driver I am using to connect to Sybase is: com.sybase.jdbc3.jdbc.SybDriver. Is that the best one to be using?

Thanks for your help.

Do you have some form onRender or columns onRender, just for test disable them, make the form as simple as possible, maybe that will give a clue what is conflicting or find the real bug

After much trial and error I found the source of this calc rendering problem and I think it might point to a bug in Servoy.

The problem seems to be with UI Converters when applied to fields that contain aggregations.

I use a UI converter to make zeros show up as blanks on the form (as described in this thread in this thread: https://www.servoy.com/forum/viewtopic.php?f=2&t=12642&p=108813&hilit=zeros#p108813. In certain cases the toObjectMethodName method is being called way too often, and I think this is messing things up.

Here is some detail:

I have a top level form with no datasource. In a tabpanel I display a form showing the current record from table A plus some aggregations like A_to_B.total_weight, A_to_B.average_weight, etc.
In a separate tabpanel on the top level form I display the A_to_B foundset in a table view.
Every time I change the record A, the toObjectMethodName method gets called anywhere from 50 to 123 times per aggregation field. After doing this 5 or 6 times, my calcs stop rendering correctly.
If I remove the UI Converter from my aggs and restart the app, the problem goes away.

I am able to reproduce this in Developer 7.4.1, Java 7.

Servoy, please let me know if I’m doing something wrong or if you need more info. Thanks.

make a case with a sample solution, then we can look at it.

Created case SVY-7166