Closed
Description
Server
- Transaction ID:
Tuple(snapshot_version UInt64, local_txid_counter UInt64, host_id UUID)
- functions:
transactionID()
,transactionLatestSnapshot()
,transactionOldestSnapshot()
- settings:
throw_on_unsupported_query_inside_transaction
,wait_changes_become_visible_after_commit_mode
,implicit_transaction
- statements:
begin transaction
,commit
,rollback
,set transaction snapshot <snapshot id>
,kill transaction where tid=<transaction id>
Java Client
- new client option
transaction_timeout
, defaults tosession_timeout
- add
ClickHouseTransaction
with methods for begin/commit/rollback transaction and snapshot - add
ClickHouseRequestManager
for generating query id and session id as well as transaction creation - enhance
ClickHouseRequest
by adding methods getTransaction and setTransaction - multiple requests can take part in one transaction - throw
ClickHouseTransactionException
forCode: 649. DB::Exception: Cannot execute query because current transaction failed. Expecting ROLLBACK statement. (INVALID_TRANSACTION)
- server will rollback automatically but still needs client to explicitly to acknowledge that by issuerollback
(usingconnection.rollback()
) - always create new session when
begin transaction
and enforcesession_check
until transaction completed - consider transaction in
retry
andfailover
(avoid node switching)
JDBC Driver
- new JDBC option
transactionSupport
(defaults tofalse
) - use
implicit_transaction
in auto commit mode, fallback to TCL when it's not supported - replace
FakeTransaction
when transaction support is enabled - change default transaction isolation level to repeatable-read(why?)
- parse TCL to maintain transaction consistency between server and client in 0.3.3?
- update SIT base classes in 0.3.3 to use docker-compose instead of standalone container and then enable tests for HA and TX in CI