Skip to content

spanner-jdbc: Step 23 - DmlBatch - #5908

Merged
olavloite merged 2 commits into
googleapis:spanner-jdbcfrom
olavloite:spanner-jdbc-23-dml-batch
Jul 30, 2019
Merged

spanner-jdbc: Step 23 - DmlBatch#5908
olavloite merged 2 commits into
googleapis:spanner-jdbcfrom
olavloite:spanner-jdbc-23-dml-batch

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

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=1WHERE 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.

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 29, 2019
@olavloite
olavloite requested a review from kolea2July 29, 2019 06:55
@olavloite
olavloite merged commit 166de8d into googleapis:spanner-jdbcJul 30, 2019
olavloite added a commit to olavloite/google-cloud-java that referenced this pull request Aug 5, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@olavloite@kolea2@googlebot