I had to modify post. It seems that the problem I had below turned out to be a database performance issue.
Please take a look at this loop:
for(int i =0; i < 100; i++)
BusinessDocument bd = getRecordFromTamino(regno);
Now here is the problem. If this database contains 100 records, the code above works fast. But if you have 88000 records then it became very slow. This does not make any sense to me. How does Tamino 4.4.1 store these records??? Is this a bug??
The function getRecordFromTamino(regno) finds the record very quickly because the regno is indexed in database. The function bd.modify() enters the current document for modification also very quickly, but bd.commit() slows down dramatically when the number of records is high in database no matter if you are really modifying something or not.
Unfortunately I am still using xapp for my Java application. My application retrieves a record to a BusinessDocument called bd and it enters bd.modify() in order to set values and at the end it applies bd.commit() to commit. However the bd.commit() part takes a lot of time for one record, i have around 80000 records to do this. Is there a faster way? I also tried to put these businessdocuments into an ArrayList and tried commitAll but it did not make a significant difference.