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

commit and roll back

Former Member
0 Likes
2,510

hai any body tell me abt commit and roll back work.plssss

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,885

Hello Sudheer,

Simply we can say like...

Commit - it saves whatever changes you have done .

Rollback - its reverse the changes done.

ROLLBACK->

In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a ROLLBACK, a new transaction is implicitly opened.

In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.

COMMIT->

In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a COMMIT, a new transaction is implicitly opened.

In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.

************************************

From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.

the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

5 REPLIES 5
Read only

former_member188829
Active Contributor
0 Likes
1,885

Hi,

Check this thread..

/thread/556398 [original link is broken]

Read only

former_member156446
Active Contributor
0 Likes
1,885

Comit will update the process we did in the LUW (search in the forum for LUW)..

roll back clears the LUW..and will not update any thing.

Read only

Former Member
0 Likes
1,886

Hello Sudheer,

Simply we can say like...

Commit - it saves whatever changes you have done .

Rollback - its reverse the changes done.

ROLLBACK->

In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a ROLLBACK, a new transaction is implicitly opened.

In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.

COMMIT->

In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a COMMIT, a new transaction is implicitly opened.

In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.

************************************

From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.

the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
1,885

Hi,

ROLLBACK->

In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a ROLLBACK, a new transaction is implicitly opened.

In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.

COMMIT->

In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a COMMIT, a new transaction is implicitly opened.

In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.

************************************

From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.

the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

***********************************

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
1,885

Hi,

Open SQL contains the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

These statements are part of the SAP transaction concept, and should only be used in this context.

As well as the COMMIT WORK and ROLLBACK WORK statements, there are other situations where data is implicitly written to the database or rolled back, and where database LUWs therefore begin and end.

Furthermore, the above statements also control SAP LUWs, which extend over several database LUWs.

The ABAP statements COMMIT WORK and ROLLBACK WORK only work like the corresponding Standard SQL statements if the entire application program is represented by a single implicit database LUW, that is, for example, in a single dialog step.

(OR)

Don't forget to reward if useful