Description
Problem to Solve
We have recently exposed a number of segfault and stalling issues caused by simple user errors: closing the transaction before a query finishes running, deleting the database and then trying to close a session... and so on.
While these are most certainly user errors, they should be handled gracefully, like any other user error. A segfault or stall is not an acceptable response in these scenarios.
Proposed Solution
We should add unhappy path tests to our Connection tests (Database, Session and Transaction). Basically just think of any scenario that could cause trouble because the user did a DB/session/tx operation they weren't meant to and write a test for it. (By tx operations, we do not mean syntactically/semantically invalid queries, but rather opening or closing a transaction at an illegal time)