add more tests and short circuit non-transient sql exceptions in detector