Throw if setting outside a write transaction