def transaction( self, transaction_type: TransactionType, options: TypeDBClusterOptions = None) -> _TypeDBTransactionImpl: if not options: options = TypeDBOptions.cluster() return self._transaction_any_replica( transaction_type, options) if getattr( options, "read_any_replica", False) else self._transaction_primary_replica( transaction_type, options)
def session(self, database: str, session_type: SessionType, options=None) -> _ClusterSession: if not options: options = TypeDBOptions.cluster() return self._session_any_replica( database, session_type, options) if getattr( options, "read_any_replica", False) else self._session_primary_replica( database, session_type, options)