When using begin_read_write_transaction to manually handle the transaction lifecycle it would be useful to be able to reuse the session when retrying transactions that fail with an ABORTED error to retain lock priority and increase the likelihood that the retried transaction can commit.
Does it sound reasonable to expose the session in the client and transaction api in this manner?
I see that the transaction finish method returns the Option<ManagedSession> as part of the error. Maybe client get_session method could be made public and there could be variants of begin_read_write_transaction and end that take & return the session? Then the user would be partly responsible for the session lifecycle as well.
When using
begin_read_write_transactionto manually handle the transaction lifecycle it would be useful to be able to reuse the session when retrying transactions that fail with anABORTEDerror to retain lock priority and increase the likelihood that the retried transaction can commit.Does it sound reasonable to expose the session in the client and transaction api in this manner?
I see that the transaction
finishmethod returns theOption<ManagedSession>as part of the error. Maybe clientget_sessionmethod could be made public and there could be variants ofbegin_read_write_transactionandendthat take & return the session? Then the user would be partly responsible for the session lifecycle as well.