Cancelling Functions in Multithreaded Applications
- Last Updated: May 12, 2026
- 1 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
In a multithreaded application, a thread can use the cancel method to cancel a statement that is being executed by another thread.
- When using the OpenAccess SDK SQL engine and the IP is checking for the cancel condition, cancel can interrupt the running statement.
- When using a third-party SQL engine that does not support cancel, cancel will have no affect on the running statement.
In both cases, the cancel method returns SQL_SUCCESS. If the cancel method has been called from a different thread while a request is pending, the original statement will return SQL_ERROR with the error message Operation cancelled.