rdbms: replace some return-based sanity checks in Database with exception-based checks