如何在嵌入式 Firebird 数据库连接上使用事件?
如果我连接到嵌入式 Firebird 数据库并创建远程事件,我会在构造函数中收到 System.NotSupportedException: Specified method is not support.. 。
_fbRemoteEvent = new FbRemoteEvent(_fbConnection); //_fbConnection is valid and Opened
查看调用堆栈中的源代码,它会导致 FesDatabase.cs,
RemoteEvent IDatabase.CreateEvent()
{
throw new NotSupportedException();
}
我使用嵌入式版本进行自动化测试......我可以做些什么来从测试上下文中的嵌入式数据库获取事件吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Firebird Embedded 支持事件,但 Firebird ado.net 提供程序 (FirebirdSql.Data.FirebirdClient) 在使用 Firebird Embedded 时不实现对事件的支持。
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.
不幸的是,Firebird 中的嵌入模式不支持事件——它们只能通过网络运行。这是因为设置事件处理程序的整个协议涉及设置到 FB 服务器的第二个网络连接——因为您在嵌入式模式下根本不使用网络连接,所以这将不起作用。
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.