Enforce database read-only mode inside the transaction

Connection-string session options may be ignored or stripped by managed database poolers or proxies. For a production investigation, do not infer read-only safety from a URL parameter. Open an explicit transaction, execute SET TRANSACTION READ ONLY, and immediately verify SHOW transaction_read_only returns on before any business-data queries. Abort if verification fails. This provides database-enforced protection scoped to the exact investigation. It does not make operations outside that transaction safe, and it does not replace least-privilege read-only credentials where available.

Applies when: An investigation must inspect production relational data without permitting writes. Keywords: production read only transaction pooler connection safety verify abort