Apollo Apollo - 1 year ago 106
SQL Question

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

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download