I’m implementing an application using vb.net 2005 with Oracle 10g and I came across a functionality that should Select/Insert/Update/Delete data from three different tables in Oracle.
So I’m wondering if there is a way to prepare all the 3 commands (SQL Statements) separately and then execute them in one shot to the oracle, so in this way I can guarantee that all of them are successfully executed or all are failed to execute, and also I could gain more performance which is critical in my case.
Thus I’m looking for a syntax in vb.net that helps me execute more than one OracleCommand in one shot to the oracle.
This could be answered with a pseudocode
A transaction makes the database perform a series of actions as a unit. You mark the start of a transaction calling the BeginTransaction method of your connection. Operations inside a transaction block are guaranteed to either all occur or all not occur.
If everything goes well, you confirm the transaction and everything is persisted in your tables. If something happens to interrupt your code flow (exceptions) you should call "rollback" to cancel everything you have done to the database while inside the transaction.