setTransactionReadOnly
fun setTransactionReadOnly(snapshotToken: String? = null, snapshotTime: Instant? = null, clockTime: Instant? = null, awaitToken: String? = null)
Makes the open transaction read-only, as SET TRANSACTION READ ONLY, … does.
A null argument leaves that option as it was; if the transaction wasn't read-only, it starts unset, and any read-write options are dropped. Each option still unset takes the connection's own when the transaction's first query pins its read basis. awaitToken bounds that pin in place of the connection's own await token.
Under manual commit with no transaction open, opens one.
Throws
outside a transaction under auto-commit, once the transaction has run a query or a write, or if awaitToken isn't a valid await token.