FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
159 stars 65 forks source link

[Firebird 3.0] [FirebirdClient 9.1.1] [FbTrace] ServiceOutput is not working #1098

Closed wryczko closed 9 months ago

wryczko commented 1 year ago

Steps to reproduce:

Given:

Firebird 3.0 database setup:

.NET 6.0 Console App setup:

trace.ConnectionString = "database=[DB_PATH];user=SYSDBA;password=[Password]"; trace.ServiceOutput += (object? sender, ServiceOutputEventArgs e) => { Console.WriteLine("Logged: " + e.Message); // called only once with message "Trace session ID 1 started" and never again }; trace.DatabasesConfigurations.Add( new FbDatabaseTraceConfiguration() { DatabaseName = string.Empty, Enabled = true, Events = FbDatabaseTraceEvents.StatementFinish, IncludeFilter = "%(INSERT|UPDATE|DELETE)%", TimeThreshold = TimeSpan.FromMilliseconds(0), });

trace.Start($"trace-{Guid.NewGuid()}");



**When:**
- New row is added to a table using any means

**Then:**

Expected behaviour:
-  trace.ServiceOutput handler's body `Console.WriteLine("Logged: " + e.Message);` is called every time there is an insert/update/delete statement executed on database

Current behaviour:
- trace.ServiceOutput handler is called only once at trace start and never again

Additional info: 
- Provided solution works with Firebird 2.5
- I've noticed that Trace mechanism has been updated in Firebird 3.0, but I don't know if I should change something in my setup https://www.firebirdsql.org/rlsnotesh/rlsnotes30.html
- according to https://github.com/FirebirdSQL/firebird/issues/7518 potential problem might be with missing remote protocol prefix when defining a service name
cincuranet commented 9 months ago

Thanks for reporting this. Turns out the new format (both supported in FirebirdClient) of trace config now requires only double quotes, while previously single and double quotes were accepted. Here's #1149 the issue tracking the root cause. I'll close this now.