Fixes for SqlExceptions. Auto closes thread.