XData database exception

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]

Any ideas? thanks.

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?

1 Like

The Firebird Version is WI-V3.0.5.33220. It is the correct client library.

I guess it is a Select as it is a call to an Entity CRUD point on the XData 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.

Best regards,

1 Like

Also, double check your XData server is using the correct Firebird client library (same version as your Firebird server).


1 Like

yes, same version

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?

1 Like

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.

No. The query usually is fine. I did have it once (I think) on my development machine, but not sure.

This should be ok as it is a standard set up XData server with Aurelius Entities.

1 Like

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?


1 Like

It's tricky as it isn't something we can just recreate at will. I'll need to set aside some time to have a serious look.