What is the difference between sql batch and transaction in orientdb?
Asked Answered
K

2

6

I have read through the documentation, and it seems that a SQL BATCH command and a transaction accomplish the same purpose, that is committing all statements as an all-or-nothing transaction.

Is this correct, or am I missing something?

I am using Orient through the PhpOrient language binding, and see that it supports both transactions and batches, but I am using SQL exclusively and would like to perform transactions using SQL only. It seems the same from my testing, but I wanted to confirm.

Krilov answered 28/7, 2015 at 15:7 Comment(0)
D
10

SQL Batch

a) SQL Batch is just that a collection of commands that need to be executed without guaranteed of success or fail.

b) Batch Processing means things are put into queue and it is processed when a certain amount if items is reached, or when a certain period has passed. You can do undo/rollback in this.

In BATCH PROCESSING, the bank would just queue xyz's request to deposit amount. The bank would just put your request in queue with all the other requests and process them at the end of the day or when they reach a certain amount.

SQL Transaction

a) SQL Transaction is a collection of commands that are guaranteed to succeed or fail totally. Transactions won't complete half the commands and then fail on the rest, if one fails they all fail.

b) Transaction is like real time processing that allows you to rollback/undo changes.

In TRANSACTIONS, it's just like the batch, but you have the option to "cancel" it.

Diastole answered 28/7, 2015 at 15:29 Comment(0)
P
1

transaction
Transactions are atomic units of work that can be committed or rolled back. When a transaction makes multiple changes to the database, either all the changes succeed when the transaction is committed, or all the changes are undone when the transaction is rolled back.
Database transactions, as implemented by InnoDB, have properties that are collectively known by the acronym ACID, for atomicity, consistency, isolation, and durability.

Mysql Manual

Passacaglia answered 24/11, 2016 at 14:10 Comment(1)
I think it is not related because the user said he was using OrientDB, not mysql.Vibraculum

© 2022 - 2024 — McMap. All rights reserved.