Commit Transaction Version 10 (Java)
Action group: Databases
Description
The action completes the current transaction and confirms all changes that were made within this 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, run a query:
Первый запрос
UPDATE Table1 SET title = 'Car' WHERE id=2
Then close the transaction and perform an additional query without closing the transaction:
Второй запрос
UPDATE Table1 SET title = 'Phone' WHERE id=3
The original view of the table:
Solution
Use the actions "Connect Standard Db", "Execute Sql Statement", "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 "Execute Sql Statement 1" action.
- Set the parameters of the "Commit Transaction" action.
- Set the parameters of the "Execute Sql Statement 2" action.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. The first transaction has been completed. The changes within the first transaction have been confirmed and saved in the database:
The subsequent queries that come after the "Commit Transaction" action are queries of the second transaction that was not closed, accordingly, the query was not executed on the database.
Обзор
Инструменты контента