Class Batch (3.55.0)

Batch(session)

Accumulate mutations for transmission duringcommit.

Methods

__enter__

__enter__()

Beginwith block.

__exit__

__exit__(exc_type,exc_val,exc_tb)

Endwith block.

commit

commit(return_commit_stats=False,request_options=None,max_commit_delay=None,exclude_txn_from_change_streams=False,isolation_level=IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED,**kwargs)

Commit mutations to the database.

Parameters
NameDescription
return_commit_statsbool

If true, the response will return commit stats which can be accessed though commit_stats.

request_optionsRequestOptions

(Optional) Common options for this request. If a dict is provided, it must be of the same form as the protobuf messageRequestOptions.

max_commit_delaydatetime.timedelta

(Optional) The amount of latency this request is willing to incur in order to improve throughput.

exclude_txn_from_change_streamsbool

(Optional) If true, instructs the transaction to be excluded from being recorded in change streams with the DDL optionallow_txn_exclusion=true. This does not exclude the transaction from being recorded in the change streams with the DDL optionallow_txn_exclusion being false or unset.

isolation_levelIsolationLevel

(Optional) Sets isolation level for the transaction.

Returns
TypeDescription
datetimetimestamp of the committed changes.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-18 UTC.