I am making a call to my XData server with the following filter (although that's not the issue - I don't think)
$filter=((Visibility eq 'Everyone') or (Visibility eq 'AnyAdmin') or ((SubmittedBy eq 101) or (OwnedBy eq 101))) and (((Status eq 'New') or (Status eq 'Queued') or (Status eq 'Processing') or (Status eq 'Processed')) or (((Status eq 'Complete') or (Status eq 'Failed')) and (DateCompleted ge '2021-11-17')))&$OrderBy=DateSubmitted
This works most of the time and is called using a timer on a WebCore, but a client testing the system had the following exception
Status code: 500 Error Code: IBNativeException [FireDAC][Phys][FB]Attempt to reclose a closed cursor | fMessage::XData server request error. Uri: [as above]
What is Firebird server version (the full version number)? Is this SELECT against a table, a stored procedure or a view? Is the Firebird client library the same version as the server?
Considering this SELECT is against a simple TABLE with NO complex calc fields, and NOT a complex VIEW or STORED PROCEDURE, and there's nothing more going on under the hoods, it can be a FireDAC bug. Also, considering your XData server is correctly using different Firebird connections per thread (request) -- sharing the same connection with different threads (requests) could lead to errors like that.
Does this exception always happens at this client or just sometimes? Is the client testing over a development enviroment or different env?
It's had to understand better what's going on without seeing any code. But I hope you can narrow down the problem.
A Google search on this error indicates an issue with Firebird, and sometimes a mismatch between client and server version.
As @Farias_Anderson said, it looks like an issue with either FireDAC or Firebird. Does this error always happen when you execute such query?
The only possible issue in XData server would be if by any chance it was implemented to use the same connection for all (simultaneous) requests. Each thread must have it's own connection or Firebird won't behave correctly.
Can you trace it (turn on Firebird trace monitor to get more info)? Also, are there any more info in Firebird.log? I've never seen this error with Firebird except when using the same connection on a multi-threaded system.
You can also update your Firebird server (and client) to last release 3.0.8 althougt I find it unlikely to be a Firebird 3 issue.
Are you using Local or TCP protocol to connect to the database?
The call stack just indicates that Aurelius tried to destroy the connection, and the error happened when the underlying TFDConnection is destroyed.
The call stack shows that the error happens when you the dispatcher is destroyed. Are you sure this happens when an endpoint is requested? It doesn't look like it.
It certainly happens on a call via a TXDataWebDataset. Whether that is the first point I'm not sure. Once it has happened then all calls have the same result.
This makes sense from what I see from the error, which looks like happens when dispatcher is destroyed. But I have no clue why it is happening. I'm afraid I will need more information, and/or a way to consistently reproduce it.