databaseManager.recalculate possible a less expansive way?

Questions, tips and tricks and techniques for scripting in Servoy

databaseManager.recalculate possible a less expansive way?

Postby [email protected] » Fri Dec 16, 2011 2:24 am

Hi to all,
we have a relation order_to_order_lines in a form of name Orders wich contains the tabpanel of the relation above.
The amount_field of the order is placed in the form Orders, and after a new record in the tabpanel we need to use "databaseManeger.recalculate", in order to update the amount of the order. But it is too much expensive (many minutes the first time we insert th first record in the tabpanel).

Any idea?

Tanks in advance.
Gianni Pinna.
[email protected]
 
Posts: 151
Joined: Sun Feb 29, 2004 10:35 pm
Location: Sassari

Re: databaseManager.recalculate possible a less expansive wa

Postby Thomas Parry » Fri Dec 16, 2011 5:53 am

How many related records are there to recalculate? Surely not that many for the "minutes" that you mention.
Have you tried doing a recalculate on just the one record rather than the whole foundset (of the relation)?
Is the amount that you talk about the sum of all the order lines = the aggregate sum of each order line? And do you use the aggregate capability?
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: databaseManager.recalculate possible a less expansive wa

Postby [email protected] » Fri Dec 16, 2011 12:50 pm

Hi Thomas,
tank You very much for Your answer.
1. ) You wrote
Have you tried doing a recalculate on just the one record rather than the whole foundset (of the relation)?


No I didn' t but I'll try.IT, OF SURE WIL BE BETTER than the command wich, in the while i gave with a good effect:

Code: Select all
order_to_lines_order.loadRecords();


2.) Moreover, Thomas, You wrote:
Is the amount that you talk about the sum of all the order lines = the aggregate sum of each order line? And do you use the aggregate capability?


Yes
Yes.
Many Tanks again, Thomas.
Hope fine for You.
Sincerly.

Gianni Pinna
[email protected]
 
Posts: 151
Joined: Sun Feb 29, 2004 10:35 pm
Location: Sassari


Return to Methods

Who is online

Users browsing this forum: No registered users and 3 guests