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 <strong>Programming</strong> for Multiple Sessions WorksWhen using database events, register them for every open session that is toreceive them. Each frame receives database events only on its currentconnection. If you register a database event and then switch to anothersession that did not register the event, the frame will not receive the databaseevent.How You Can Keep Track of the Current SessionThe DBSession attribute, defined for the ProcExec class and inherited by theGhostExec, FrameExec, and MethodExec classes, identifies the currentdatabase session for the application. This attribute contains theDBSessionObject object.For more information about using this attribute, see How You Can SwitchDatabase Sessions (see page 193).How You Can Access the DBSessionObject ObjectEach open database session in an application has an associatedDBSessionObject object. The attributes of this object identify the databaseassociated with the session, the session's ID, and the DBMS flags with whichthe session was opened. There are also DBSession Object attributes thatprovide status information about the session:DatabaseContains the name of the database accessed by the sessionDBMSErrorContains the database-specific error number associated with the mostrecently executed SQL statement in the sessionErrorNumberContains the generic error numbers of any error resulting from the mostrecently executed SQL statement in the sessionRowCountStateContains the number of rows affected by the most recently executed SQLstatement in the sessionContains the connection state of the session (DS_CONNECTED orDS_DISCONNECTED)For more information about the DBSessionObject's attributes, see theLanguage Reference <strong>Guide</strong> online help.Working with a Database 189

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

Saved successfully!

Ooh no, something went wrong!