Begin detailed description.

This figure depicts two threads that call functions in a way that causes an error. The following table presents the order in which these functions are executed and indicates which thread calls each function:
Function Thread
rc = SQLExecDirect( hstmt1 , ... ); 1
SQLFreeHandle( hstmt1 , SQL_DROP); 2
rc = SQLExecDirect( hstmt1 , ... ); 1
Because thread 2 frees the statement handle before thread 1 finishes executing statements, the second call to SQLExecDirect() returns SQL_INVALID_HANDLE.

End detailed description.