Adapt for addition of transaction pre-begin hook.
Add database-read-only option.