cancel
Showing results for 
Search instead for 
Did you mean: 

Role of COMMIT WORK statement

former_member186584
Participant
0 Kudos

Hello Experts,

I have a question regarding the COMMIT WORK statement when the underlying database is HANA.

My observation has been - when the underlying DB is MS-SQL, a statement like - INSERT dbtab FROM wa does not need a COMMIT WORK statement after the INSERT. The contents of wa are inserted into the dbtab immediately after the execution of the INSERT statement. On the other hand, this is not the case, when the underlying database is HANA. On an A4H (ABAP for HANA) system, the execution of INSERT dbtab FROM wa does NOT immediately insert the contents of wa to dbtab. Only when a COMMIT WORK statement is used after the INSERT, the insertion of the new record takes place.

Could you please help me understand why this is happening? Thanks for your time and effort.

View Entire Topic
lbreddemann
Active Contributor
0 Kudos

Hi there,

could it be that on your MS SQL database you use a "READ UNCOMITTED" session/connection to check for the inserted data?

The standard behavior for all database platforms is: in sessions other than your own, show the data only after commit. That's the whole point of transactional isolation.

As far as I know, MS SQL is the only platform where we use "READ UNCOMMITTED" sessions, so I reckon this might be leading to the funny (and often problematic) effect that you can see data that has not yet been comitted to.

However, the session that executed the INSERT statement will always be able to see the new records right away.

- Lars