Suppose I have code with multiple stored procedures executing from c# code. Each of the stored procedures have a commit and a rollback in a case of exception. The exceptions are handled within these stored procedures and return a handled error messages.
If i have a an OracleTransaction.BeginTransaction() "running", on the same connection object when executing stored procedures would an OracleTransaction.Rollback() in c# code actually rollback on a data commmited by previously executed stored procedure.
Logic as follows:
- Open connection
- Begin transaction
- Execute one stored procedure (with commit inside)
- If all good, execute another stored procedure (with commit). If not, rollback previous stored procedure and stop altogether.
- No errors commit transaction. Thank you.
A
COMMIT
ends the current transaction, and a new transaction begins with the next executable SQL statement. As a result a subsequentROLLBACK
can only undo changes made since the previousCOMMIT
, but not before that.