I am using Softvelocity’s Clarion to make windows applications. The problem I am facing is in a Multi-Thread environment, I need to call a function to retrieve some data from a firebird database through ODBC. The function works good and return correct result if running one at a time. But when I need to call the function a few times simultaneously (multi-thread), the app crashes.
After a lot of experiments, I figure out the reason should be there is only 1 single ODBC connection for the entire app and when the SQL command fires together (multi-thread) that cause the crashes.
The program structure is:
Main : a loop of 5 times to call the function using START(MultiThread) command
MultiThread: to call the function with result returned, named GetUser()
GetUser: the place where I open the user table, fetch record, close user table, and disconnect
I understand there may not be many active Clarion users here, but any advices are appreciated.