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 EventsFor example, assume that Frame A switches back and forth between twoSessions, 1 and 2. If the frame issues a register dbevent in Session 1, then theframe processes the specified event only when it is working in Session 1. If theframe happens to be working in Session 2 when the event reaches the top ofthe frame's event queue, the event is discarded. (For more information aboutthe interaction of database events and multiple sessions, see How DatabaseEvents Work with Multiple Sessions (see page 358).)The application's effective user must have permission to register events. (Theeffective user is the user name under which the application is running.) In amulti-session application, each session can be running under a different username. If you want to execute the register dbevent statement in a particularsession, you must ensure that its effective user has the register privilege.How You Can Raise an EventRegistrations are valid as long as the session in which they were executed isopen or until you use the remove dbevent statement to unregister the event.Using the remove dbevent statement removes the registration only for theframe where you execute the remove dbevent statement. You must issue thisstatement in the same session in which you registered the event.Disconnecting a session automatically removes all of the event registrationsassociated with that session for all frames.To send a database event, you use the raise dbevent statement. Thisstatement sends the specified database event to the DBMS for distribution tothose applications registered to receive the event, for example:on click ={buff = 'Sending DBEvent';raise dbevent myevent :buff;commit;}To issue the raise dbevent statement, the application's effective user must ownthe specified database event or must have the raise privilege. In a multisessionapplication, this means that the effective user of the session thatissues the statement must either own the specified event or have the raiseprivilege.How You Can Purge Database EventsThe PurgeDBEvent method lets you remove database events from a frame'sevent queue. The syntax follows:integer = GhostExec.PurgeDBEvent([dbeventname =varchar(256)])360 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!