Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@olavloite
Copy link

Adds DmlBatch. DML batches are similar to DDL batches, except they execute DML instead of DDL statements. DML batches are executed like this:

START BATCH DML;
UPDATE FOO SET BAR=1 WHERE ID=2;
RUN BATCH;

An active batch can be aborted by executing the ABORT BATCH statement.

DML batches can be executed while the transaction is in autocommit mode, which means that the effects of the batch will be visible to all other users directly after the RUN BATCH statement has finished executing. DML batches can also be executed as part of a read/write transaction. As a connection only allows one UnitOfWork to be active at any time, and both a read/write transaction and a DML batch is a UnitOfWork, the DML batch is executed as an nested batch of the active transaction. When RUN BATCH is executed, the batch of DML statements are executed on the active read/write transaction, and its effects will only be visible to other users once the transaction has been committed.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 29, 2019
@olavloite olavloite requested a review from kolea2 July 29, 2019 06:55
@olavloite olavloite merged commit 166de8d into googleapis:spanner-jdbc Jul 30, 2019
olavloite added a commit to olavloite/google-cloud-java that referenced this pull request Aug 5, 2019
* add DmlBatch

* updated CR year
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants