databaseManager.recalcualte(record) in HC, calcs in module

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby jcompagner » Mon Jan 03, 2011 9:00 pm

as far as i know there is no case for this,
please create a case and if possible a sample solution and do test it again first on 5.2.4 because i am not going to try build a complete sample and then come to the conclusion that it works perfectly.
And i still don't know exactly what you are doing.. Are you using db transactions only? or in mem transactions or a combination?
We just have to guess way to much, that cost us quite some time, and many times we then also still can reproduce it, that is a waste of our time.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby ryanparrish » Tue Jan 04, 2011 12:20 am

jcompagner wrote:And i still don't know exactly what you are doing.. Are you using db transactions only? or in mem transactions or a combination?
We just have to guess way to much, that cost us quite some time, and many times we then also still can reproduce it, that is a waste of our time.


Jeff and I may have not been clear enough, but we are working on the same solution in the same office. It's mentioned in the thread by one of us that we do everything with db transactions (MySQL InnoDB), and I mentioned here viewtopic.php?f=25&t=15258&st=0&sk=t&sd=a&start=30#p82967 that I've tried every other way I could think of in desperation, but as a rule, 100% of our code that updates or creates data we wrap it within a transaction. Furthermore we make sure to wrap our find()'s that return data to be used in the insert/update within the same transaction to ensure consistent data with proper record locking.
ryanparrish
 
Posts: 162
Joined: Thu May 17, 2007 7:49 pm
Location: Miami, FL

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby jcompagner » Tue Jan 04, 2011 10:11 am

the only thing i can say is that you should see the update statements in the performance log right after you have called: databaseManager.recalculate(record) if you are just using db transactions.
If that is not the case, create a case with a sample so that we can look at it.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby amcgilly » Sat Jan 08, 2011 1:55 am

I have a related question.

We are working on a large FileMaker to Servoy conversion. The FM tables have tons of calcs, both stored and unstored. Some of the unstored calcs we are converting to stored calcs because they are used in relationships. We need to initialize these for all rows in the table so we run databaseManager.recalculate on a foundset based on the whole table. Here's our code:

Code: Select all
function _recalculateTable(tablename) {
   var fs = databaseManager.getFoundSet(globals.servername, tablename)
   fs.loadAllRecords()
   databaseManager.recalculate(fs)
   application.output(tablename + ' recalc done');
}


The calcs in these tables are pretty straightforward, and yet for a table containing say 10,000 rows the recalculate can take several hours. And what's strange is that Servoy is using very little CPU time during this operation.

Am I doing something wrong? Is there some way to speed this up?

Thanks.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby david » Sat Jan 08, 2011 1:58 am

amcgilly wrote:We need to initialize these for all rows in the table

...

Is there some way to speed this up?


SQL update statements.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: databaseManager.recalcualte(record) in HC, calcs in module

Postby Robert Huber » Sat Jan 08, 2011 1:52 pm

Hello Adrian

How are your memory settings for Java and the database (which database are you using?). May be you can show code snippets where we can see your memory settings. Memory settings have a great influence on speed for calcs.

Regards,
Robert Huber
7r gmbh, Switzerland
SAN Developer
www.seven-r.ch
User avatar
Robert Huber
 
Posts: 1239
Joined: Tue Aug 23, 2005 6:52 pm
Location: Schaffhausen, Switzerland

Re: databaseManager.recalcualte(record) in HC, calcs in modu

Postby jbader » Sun Feb 06, 2011 7:35 pm

I wanted to make a quick post on this topic to thank the Servoy dev team for fixing the issues I was encountering with calculations. 5.2.4 for me is working as expected.

Much appreciated!

Both databroadcasting and calculations are now predictable and consistent.
jbader
 
Posts: 520
Joined: Sun Sep 18, 2005 4:24 am
Location: Miami, FL

Re: databaseManager.recalcualte(record) in HC, calcs in modu

Postby pbakker » Mon Feb 07, 2011 11:02 am

Hi Jeff,

Glad it worked out. Tnx for reporting back.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Previous

Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 5 guests