added read only database flag, convenience method for creating errors