10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Communicate Between OpenROAD Applications Using Database EventsHow You Can Communicate Between OpenROADApplications Using Database EventsDatabase events are user-defined events. They are created and manipulatedusing SQL statements and stored in a database. Database events are a way fortwo programs that are connected to the same database to communicate. Usinga database event, one program can inform another that some predefined eventhas occurred. The receiving program then can take whatever action isnecessary. Database events allow a program to send up to 256 bytes ofinformation to another program.How Communication Using a Database Event WorksCommunication using database events is two-way: any application can eithersend or receive a database event.To use a database event, you would perform the following basic steps:1. Use the SQL create dbevent statement to create the database event.2. In the receiving application, use the SQL register event statement toregister frames to receive the event.3. In the frames' scripts, write the database event blocks.4. In the sending application, use the SQL raise dbevent statement to sendthe event.When an application executes a raise dbevent statement, the application sendsthe specified event, and any specified text, to the DBMS. In turn, the DBMSsends it to any application that is registered to receive the event and isconnected to the same database as the sending application.In OpenROAD, applications poll regularly for database events from the DBMS.The DBEventPollrate attribute defined for the SessionObject determines thetime interval between each polling.When an OpenROAD application polls and finds a waiting database event, itplaces the event on the native event queue and initializes a separateDBEventObject for each frame registered to receive the event. When the eventreaches the top of the native event queue, OpenROAD dispatches it to theappropriate frame queues.Inter-Frame Communication Techniques 357

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!