Commit commands must be within a sqlLock
on exception during a SQL execute, show user the SQL line that caused the exception
Wrap all sock.shutdown functions in error handlers because evidently these can fail on some OSs if the socket is already shut down from earlier.