Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Program completion before database commit

former_member182337
Participant
0 Likes
940

Hello friends,

I am doing a mass update using batch input program. The issue is that my program completes before actual database commit.My requirement is to create info records and after calling the standard batch input program , i am checking the standard tables if the info record is created or not. If yes, am updating the numnbeer else am updating an error message,

The problem is that for some 200 odd records there is no issue but if the no of records exceeds say 1000 or more, the background process of batch input program continues and then my code to check if the info record is created gets called. At this time,the database is still getting updated and there is no info record getting filled( info record actually gets updated in the standard tbale after few mins).

I am pretty sure this is to do with database commit issue and can actually use wait statement but then i cannot always expliciltly say wait up to 100 seconds because the user can choose 1000 records or 1 record at a time. How to ensure that the database gets updated before my checking of the info record in the table.

Please help.

Regards,

Prem

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
886

hi,

u can use commit keyword for ur purpose

thanks

chaitanya

5 REPLIES 5
Read only

Former Member
0 Likes
886

Hi,

Try the following command before looking for info records in the database..

COMMIT WORK AND WAIT.

WAIT UP TO 2 SECONDS.

If this doesnt work.. then i feel you should split the program...

1st create all info records..capture the success/error messages.. once done

call the 2nd part which is related to validation of info record in database.

Thanks,

Best regards,

Prashant

Read only

0 Likes
886

Hello,

I have tried with commit statement and also commit work and wait but still before the database update the select query is called and the output is that no data exist in the internal table. Are there any solution to fix this without having to modify the program or split the program into two?

The program is working as expected except for this issue.

Regards,

Prem

Read only

Former Member
0 Likes
887

hi,

u can use commit keyword for ur purpose

thanks

chaitanya

Read only

Harsh_Bansal
Contributor
0 Likes
886

Hi,

Put your code in a FM..in FM attributes declare it as Update FM..

Now in place of your code, call this FM in update task.

In this way, it will be called after the Commit.

Your problem will be solved.

Please revert for any queries.

Regards,

Harsh Bansal

Read only

0 Likes
886

Thanks all. Your answers were helpful. I used while endwhile to fix this.