Ensure read-only transactions

Closes #2142