KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: REST Error Message: "Can't call not thread safe method from a preemptive process"
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: October 28, 2024

{
   "__ERROR":[
      {
         "message": "Can't call not thread safe method from preemptive process.",
         "componentSignature": "4DRT",
         "errCode":-10529
      }
   ]
}

The above error message can occur when using a REST request to call a class function in a compiled application. For example, the error can occur when sending a request like this:

"http://127.0.0.1/rest/example_class/example_funciton"

This error is caused by the class function being non-thread safe, which means that it includes either interprocess variables or commands which are non-thread safe. In order to use REST in a compiled application, the database must be thread-safe. To fix this error message the code must be refactored to eliminate any interprocess variables or non-thread safe commands.