private void CommitToSpanner() { // If it's a read-only transaction, then just tell the outer transaction that everything is good. // This can happen with a read-only transaction or a write transaction where we never // executed any mutations. if (_transaction != null && _transaction.Mode != TransactionMode.ReadOnly) { ExecuteHelper.WithErrorTranslationAndProfiling(() => _transaction.Commit(), "VolatileResourceManager.Commit", Logger); } }
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment) { try { ExecuteHelper.WithErrorTranslationAndProfiling(() => _transaction?.Commit(), "VolatileResourceManager.Commit"); singlePhaseEnlistment.Committed(); } catch (SpannerException e) { singlePhaseEnlistment.Aborted(e); } catch (Exception e) { singlePhaseEnlistment.InDoubt(e); } finally { Dispose(); } }