private void CheckWriteTransaction() { if (!inTransaction || readOnly) throw new InvalidOperationException(); } }