DB Access Module for Sybase User’s Guide : Chapter 2 Technical Information : Open SQL and Sybase Open Client Client-Library : Simultaneous Result Processing
Simultaneous Result Processing
Each RWDBOSql object corresponds to a CS_COMMAND structure. A CS_COMMAND structure is created and associated with an RWDBOSql object only when the execute() method is invoked on the RWDBOSql object. The CS_COMMAND structure remains associated with the RWDBOSql object until it goes out of scope, or until execute() is invoked on the object using a different connection. Invoking execute() on the same connection reuses the same CS_COMMAND structure.
Simultaneous Results Processing of RWDBOSql Objects on the Same Connection
When executed on an RWDBConnection for the first time, every RWDBOSql object creates and associates itself with a new Sybase Client-Library specific CS_COMMAND structure. Though Sybase Client-Library allows many CS_COMMAND structures on the same connection, it doesn’t allow execution of any SQL statement on a CS_COMMAND structure while another CS_COMMAND structure on the same connection is processing a result set. The net effect is that, although many CS_COMMAND structures from the same connection are possible, simultaneous processing of results on the CS_COMMAND structures from the same connection is not possible.
To relieve the burden of ensuring that only one RWDBOSql object at a time processes results on a connection, the DB Access Module for Sybase cancels pending results on the last used RWDBOSql object before processing a new command on a new RWDBOSql object. This feature ensures that applications do not have to process the results of one RWDBOSql object completely before executing new commands on another.
In summary, applications are prohibited from simultaneously processing results on multiple RWDBOSql objects on the same connection. This restriction does not apply to RWDBOSql objects on different connections.
Simultaneous Results Processing of High-Level Objects of the DB Interface Module Using the Same Connection
High-level objects of the DB Interface Module, like RWDBSelector and RWDBInserter, for example, are internally associated with unique RWDBOSql objects. For this reason, these high-level objects are also restricted from simultaneously processing results on RWDBOSql objects on the same connection. Also see “Simultaneous Results Processing of RWDBOSql Objects on the Same Connection” .