Programming Guide : 5. Working with a Database : How You Can Manage Transactions : How You Can Manage Transactions with Bitmaps, String Objects, Long Byte Objects, Long Vchar Objects, and Data Streams
 
Share this page                  
How You Can Manage Transactions with Bitmaps, String Objects, Long Byte Objects, Long Vchar Objects, and Data Streams
Three methods are associated with the BitmapObject and StringObject system classes that interact directly with the database:
InsertIntoDB
UpdateInDB
DeleteFromDB
Two methods are associated with the LongByteObject and LongVCharObject system classes that interact directly with the database:
FetchFromDB
UpdateInDB
Four methods are defined by the DataStream system class:
Open
SetCols
Close
NextRow
Three additional methods are defined for the QueryObject subclass:
DBInsert
DBUpdate
DBDelete
If no transaction is open when one of these methods is executed, its execution initiates a transaction. If a transaction is open, then the work performed by the method becomes part of the transaction.
Like any other work performed by a database statement, the work is not committed to the database until the transaction of which it is a part is committed. If the program issues a rollback statement, any work performed by one of these methods in the affected transaction is also undone.
Similarly, if you set the DBHandle attribute of either a bitmap or StringObject object, you access the database. Setting the DBHandle can initiate a transaction, and commit and rollback statements affect the statements that set a DBHandle attribute.
For more information about setting a DBHandle directly, see How You Can Use the ErrorStatus Attribute. For more information about detecting and handling DBMS errors in DataStream objects, see How You Can Handle DataStream Errors.