General discussion

Locked

Commit/Rollback.....

By jhill ·
I'm trying to add logic to an existing process...
Here it is... Bear with me...
The process is looping and for each loop, it performs a commit or a rollback.
The new logic needs to insert some new data

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Commit/Rollback.....

by john.payne In reply to Commit/Rollback.....

Assuming the commit or rollback is performed based on the success or failure of the existing DML statments inside the loop, add your new logic to the block where the commit would have been performed and move your commit/rollback logic inside this same block, after testing for success/failure of your insert statements.
i.e.
if success then
commit
else
rollback
endif

would become...
if success then
insert statment

if success then
commit else
rollback
endif
endif

Hope this helps.

Collapse -

Commit/Rollback.....

by jhill In reply to Commit/Rollback.....

The question was auto-closed by TechRepublic

Collapse -

Commit/Rollback.....

by ruvic In reply to Commit/Rollback.....

Some database like oracle has a special feature called "Savepoint" wherein you can selectively commit/rollback specific part of your code.

Please check with your database.

Collapse -

Commit/Rollback.....

by jhill In reply to Commit/Rollback.....

The question was auto-closed by TechRepublic

Collapse -

Commit/Rollback.....

by jhill In reply to Commit/Rollback.....

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Software Forums