Notifications
Announcements
No record found.
I have 7000 pieces of data to process.
However, after the following logical processing, I found that only 210 entries actually entered the database。
data = GetData();
while(data.next())
{
TableTmp.clear();
.......
list.add(TableTmp);
}
Table.truncate();
list.insertDatabase();
After debug, it is found that the number of while cycles is thousands.
But there are only a few hundred data stored in the database
The following explanation can be seen in some places
When the amount of data is too large, in list. Add(), the data will be submitted to the database.
In this way, because I added truncate before insert, the data previously submitted to the database will be cleared.
Since no official explanation has been found, it is uncertain whether this is the reason.
And what is the amount of data control
Hi xiaoshuai.fan,
If you have overriden the insert method of the table, the insert will be made row by row and it take time.
There is adocumentation of RecordInsertList class and set-based operations that it is useful and also you can read all four parts of Ax 2012 - RecordInsertList - Performance series.
Also, creation a DMF entity for your table or a batch process with multiple threads can be a good idea for you.
I also think that truncating the table before actually in the middle of the process is a bad idea.
There is an easy way to be certain - throw away the call of truncate() and try it again.
By the way, what are you trying to achieve by truncate()?
Thanks for your reply
In fact, I have adjusted the order of truncate and the error has been solved.
I want to confirm whether this setting really exists.
【when the amount of data is too large, list. Add() is executed ,the data will be directly inserted into the database】
If there is such a setting, where can I find the specific content
Yes, add() may insert a bunch of records to database. insertDatabase() ensures that all not-yet-inserted records are inserted as well.
No, it's not configurable, as far as I know.
My code includes the processing of ttsbegin and ttscommit,
So it is only possible to add all or fail all.
So I suspect that the problem occurs when the data is added to the database and then deleted by truncate.
Is there any information available in this regard?
Do you think my understanding is correct
Small amount of data:
Recordinsertlist. Add(): inserts data into the list
Recordinsertlist. Insertdatabase(): inserts all data in the list into the DB
When the amount of data is large:
Recordinsertlist. Add(): inserts part of the data directly into the DB
Recordinsertlist. insertdatabase(): ensure all data is inserted
So is there any documentation of these settings?
These are not settings; it's how the behavior of RecordInsertClass has been implemented.
You can find a bit more details in documentation of RecordInsertClass class.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 456 Super User 2025 Season 2
Martin Dráb 429 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional