Cannot Receive POST_EVENT Data from FirebirdSql.Data.FirebirdClient Events
--------------------------------------------------------------------------

                 Key: DNET-931
                 URL: http://tracker.firebirdsql.org/browse/DNET-931
             Project: .NET Data provider
          Issue Type: Bug
    Affects Versions: 7.5.0.0
         Environment: Windows 10, FireBird 2.5, .NET Core 3.1
            Reporter: kickinespresso
            Assignee: Jiri Cincura


annot Receive POST_EVENT Data from FirebirdSql.Data.FirebirdClient Events

Windows 10, FireBird 2.5, .NET Core 3.1

Using the code from the example here: 
https://github.com/FirebirdSQL/NETProvider/blob/ccb602aa4eb373267423c37bc176ff04fba1d099/Provider/docs/events.md
 
I am not able to receive POST_EVENT from FireBird.

I was able to use the FirebirdSql.EntityFrameworkCore.Firebird DB Content just 
fine. Docs here: 
https://github.com/FirebirdSQL/NETProvider/blob/master/Provider/docs/entity-framework-core.md
 

Here is my sample Code: https://github.com/cdesch/FireBirdConsoleExample

In my setup (below), I create the database, table and trigger. I also verified 
that they are working by assigning a new value to FooBar inside the trigger.

When listening for the event on the FirebirdSql.Data.FirebirdClient side, 
nothing happens. 

What am I doing wrong?

/* Here is the Script I used for creating the Database */
CREATE DATABASE 'C:\data\demo.fdb' page_size 8192
user 'SYSDBA' password 'masterkey';

CONNECT "C:\data\demo.fdb"
user 'SYSDBA' password 'masterkey';

create table demo (id int primary key, foobar varchar(20) character set utf8);
insert into demo values (6, 'FooBar');

set term !! ;
CREATE TRIGGER NEW_DEMO_RECORD_TRIGGER FOR demo
ACTIVE before insert
AS BEGIN
  IF (inserting) THEN
        BEGIN 
          new.foobar = 'NewFoobar';
          POST_EVENT 'NEWFOOBARD_POSTEVENT';
        END
END!!
set term ; !!

insert into demo values (7, 'FooBar');

select * from demo;

insert into demo values (8, 'FooBar'); 


/* Results */
Use CONNECT or CREATE DATABASE to specify a database
SQL> CREATE DATABASE 'C:\data\demo.fdb' page_size 8192
CON> user 'SYSDBA' password 'masterkey';
SQL> CONNECT "C:\data\demo.fdb"
CON> user 'SYSDBA' password 'masterkey';
Commit current transaction (y/n)?y
Committing.
Database:  "C:\data\demo.fdb", User: SYSDBA
SQL> create table demo (id int primary key, foobar varchar(20) character set 
utf8);
SQL> insert into demo values (6, 'FooBar');
SQL> commit;
SQL>
SQL> set term !! ;
SQL> CREATE TRIGGER NEW_DEMO_RECORD_TRIGGER FOR demo
CON> ACTIVE before insert
CON> AS BEGIN
CON>   IF (inserting) THEN
CON> BEGIN
CON>   new.foobar = 'NewFoobar';
CON>   POST_EVENT 'NEWFOOBARD_POSTEVENT';
CON> END
CON> END!!
SQL> set term ; !!
SQL> insert into demo values (7, 'FooBar');
SQL> select * from demo;

          ID FOOBAR
============ 
===============================================================================
           6 FooBar
           7 NewFoobar

SQL> insert into demo values (8, 'FooBar');
SQL> commit;
SQL> select * from demo;

          ID FOOBAR
============ 
===============================================================================
           6 FooBar
           7 NewFoobar
           8 NewFoobar

SQL>


/* Output of the console */

Hello World!
Listening...

info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 2.1.2-rtm-30932 initialized 'MyContext' using 
provider 'EntityFrameworkCore.FirebirdSql' with options: None
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (6ms) [Parameters=[], CommandType='Text', 
CommandTimeout='30']
      SELECT "d"."ID", "d"."FOOBAR"
      FROM "DEMO" "d"
678
C:\Users\chris\source\repos\FireBirdConsoleExample\FireBirdConsoleExample\bin\Debug\netcoreapp3.1\FireBirdConsoleExample.exe
 (process 27392) exited with code 0.
To automatically close the console when debugging stops, enable 
Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to