How to use events on an Embedded Firebird database connection?
-
09-10-2019 - |
Pergunta
If I connect to an embedded Firebird database, and create a remote event, I get System.NotSupportedException: Specified method is not supported.. on the constructor.
_fbRemoteEvent = new FbRemoteEvent(_fbConnection); //_fbConnection is valid and Opened
Looking at source code from call stack, it leads to FesDatabase.cs with
RemoteEvent IDatabase.CreateEvent()
{
throw new NotSupportedException();
}
I use the embedded version for automated tests purpose ... Is there something I can do to get event from the embedded database in a test context?
Solução
Events are unfortunately not supported in embedded mode in Firebird -- they can only be run over the network. This is due to the fact that the whole protocol of setting up an event handler involves setting up a second network connection to the FB server -- as you're not using a network connection at all in embedded mode, this won't work.
Outras dicas
Events are supported in Firebird Embedded, but the Firebird ado.net provider (FirebirdSql.Data.FirebirdClient) does not implement support for events when using Firebird Embedded.