xData Lost Connection

I'm starting tests with xData.
I realized a situation and could not determine the cause.
When the server (xData) goes without requests for some time, there is a 500 status return in the first request that arrives. If I repeat the same request immediately after the error return, it comes with a successful response. This occurred with tests on FireDAC, IBExpress and MyDAC.
There is no error if the Server is always receiving requests.

That’s something at database connection configuration level (FireDAC level for example). XData uses connection pools, thus the components are connected, used and then returned and kept in the pool.

Probably after some time the component is disconnected automatically due to time out. Then a new client request comes, and it tries to reuse the existing connection, which is disconnected, and such error appears.

I'd suggest you investigate in your component you are using (is if FireDAC, eventually), there might be some property that automatically reconnects without raising any error.