Rollback Transaction Version 9 (Java)
Action group: Databases
Description
Action rolls back the current transaction
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
DB context | Connection context to the selected database | Robin.DbContext | Database context | Yes |
Special conditions of use
None.
Example of use
Task
Connect to the database, execute the query:
Первый запрос
UPDATE Table1 SET title = 'Car' WHERE id=2
Then rollback the transaction and execute the following request:
Второй запрос
UPDATE Table1 SET title = 'Phone' WHERE id=3
At the end, close the transaction.
Initial view of the table:
Solution
Use the actions "Connect Standard Db", "Execute Sql Statement", "Rollback Transaction", "Commit Transaction".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters for the "Connect Standard Db" action (Instructions on how to connect to Microsoft SQL Server from Robin Studio).
- Set the parameters for the "Execute Sql Statement 1" action.
- Set the parameters for the "Rollback Transaction" action.
- Set the parameters of the next action "Execute Sql Statement 2".
- Set the parameters of the "Commit Transaction" action.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully.
The first transaction rolled back, so the changes were not applied to the database. The second transaction was closed and applied to the database:
Обзор
Инструменты контента