Application Development 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: 

How Commit works?

Former Member
0 Kudos

Hello all,

A question:

We are having some problem running a JOB. The job is taking too much time to finish. However at end the Commit occurs.

Let´s suppose:

We are running a Program (in BACKEND) that updates a table

The Backend process has not finished (meaning: commit does not happen yet).

At same time, in a FRONTEND (portal), user is doing changes that affect the same program above.

The question is:

At the moment user makes the change(s), can this change occurs in the Backend process which is running?

Perhaps the question should be:

“The entry(ies) in the Backend Process is LOCK when program is running? Then in this case if user makes a change in Frontend the change is not gonna happen in the Backend process? “

Can someone help me out to understand this process.

Thanks in advance!

Regards,

Barbara

1 ACCEPTED SOLUTION

Former Member
0 Kudos

if its ur own programm set some commit befor the programm is finished. So u can devide the data that have to be stored in the DBtab's.

For example if u try to write 10 000 entries to a DBtab set some commit work after each 1000 entries.

It will write Data in DBtab after each 1000th entry even if ur Programm crashes or got shut down during runtime.

To make sure no one changes the data while u work on it u need to lock it.

Depedning on the kind of Data ur using there maybe some FM that will do the lock and unlock for u.

And if u use standard FM's to change the data they wont change it while the data is locked.

Regards

Stefan Seeburger

9 REPLIES 9

naimesh_patel
Active Contributor
0 Kudos

You should make one LOCK object on your table data. So, whenever you job is running your data would be locked. And at the same time if some user tries to change the data he will get the error message of locked data.

Now, when you job is modifying some data and the commit work doesn't happen yet and somebody changes those data and save... than the data which was entered by user will be overwritten by the job's COMMIT WORK.

Hope it helps.!!

Regards,

Naimesh Patel

0 Kudos

Hello Naimesh

Many thanks for your replay!!!! I am new in this subject and I have some little questions to be totally clear.

Following what you said in your last statement:

<i>“…when you JOB is modifying some data and the commit work doesn't happen yet and somebody changes those data and save...then the data which was entered by user will be overwritten by the job's COMMIT WORK.”</i>

Questions:

1) In this case this will happen if the program is running without LOCK object, isn’t it?

In our situation here: The JOB is take too much time to run

2) Is that possible that this occurs because the program is running without LOCK object?

3) Is there anyway to check if the program did run with or without LOCK object?

Many Thanks,

Barbara

0 Kudos

>

> 1) In this case this will happen if the program is running without LOCK object, isn’t it?

>

> In our situation here: The JOB is take too much time to run

> 2) Is that possible that this occurs because the program is running without LOCK object?

>

> 3) Is there anyway to check if the program did run with or without LOCK object?

1. looks like, yes

2. no, the speed of the report does not depend if any lock was applied or not

3. do you mean after the report finished? you can only check the source code of the program, that's it. or probably some system log (SM21?) would be helpful, but I am not sure.

Former Member
0 Kudos

Thanks for the answers.

It helps me a lot to understand a bit about COMMITS.

Regards,

Barbara

0 Kudos

I can speak about Oracle databases. If process A changes a table entry and does not commit but continues to do other stuff, another process B trying to change that same table entry would have to wait until process A has finally committed the change.

The situation would result in a database lock which can be analysed via transaction DB01.

This is independent of locks on the application level.

Thomas

Former Member
0 Kudos

Closing this thread.

Former Member
0 Kudos

Former Member
0 Kudos

if its ur own programm set some commit befor the programm is finished. So u can devide the data that have to be stored in the DBtab's.

For example if u try to write 10 000 entries to a DBtab set some commit work after each 1000 entries.

It will write Data in DBtab after each 1000th entry even if ur Programm crashes or got shut down during runtime.

To make sure no one changes the data while u work on it u need to lock it.

Depedning on the kind of Data ur using there maybe some FM that will do the lock and unlock for u.

And if u use standard FM's to change the data they wont change it while the data is locked.

Regards

Stefan Seeburger

Former Member
0 Kudos

Thanks for all answers.

All of them has helped me a lot to understand a bit about COMMITS.

Many Thanks all, and Closing this thread,

Barbara