12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>C++</strong>Builder Database Architecture<br />

The TransIsolation property controls the transaction isolation level (TIL) on the database<br />

server. The TIL on the server controls the accessibility of concurrent transactions to changes<br />

made by one another.<br />

TransIsolation has three possible values: tiDirtyRead, tiReadCommitted, and tiRepeatableRead<br />

(default is tiReadCommited). These TransIsolation values have the follow<strong>in</strong>g effects:<br />

■ tiDirtyRead—Uncommitted changes by other transactions are visible.<br />

■ tiReadCommitted—Only committed changes by other transactions are visible.<br />

■ tiRepeatableRead—Changes by other transactions to previously read data are not<br />

visible, which means that every time a transaction reads a given record, it always<br />

gets the exact same record.<br />

The StartTransaction method marks the beg<strong>in</strong>n<strong>in</strong>g of a group of database changes that you<br />

want to be treated as a unit. They will either all be applied to the database or none of them<br />

will be.<br />

NOTE<br />

Commit makes permanent the database changes that have occurred s<strong>in</strong>ce the transaction was<br />

started. Th<strong>in</strong>k of it as a database save command.<br />

Rollback discards the database changes that have been made s<strong>in</strong>ce the transaction began.<br />

Th<strong>in</strong>k of it as a database undo command.<br />

TTable<br />

You can also control transaction process<strong>in</strong>g on your server us<strong>in</strong>g<br />

Passthrough SQL. To do this, you issue SQL commands that change<br />

the transaction process<strong>in</strong>g on your server. Be aware that do<strong>in</strong>g this with<br />

SQLPASSTHRUMODE set to SHARED AUTOCOMMIT or SHARED NOAUTOCOMMIT<br />

could cause your new TIL sett<strong>in</strong>g to affect other transactions <strong>in</strong>itiated<br />

by your application.<br />

Module: DBTables Class ancestor: TDBDataSet<br />

TTable is a direct descendant of the TDBDataSet class and an <strong>in</strong>direct descendant of the<br />

TDataset class. You access database tables us<strong>in</strong>g the TTable component. When you open a<br />

TTable, you establish a connection between your application and the table. You add, change,<br />

and delete rows <strong>in</strong> database tables us<strong>in</strong>g the TTable component.<br />

Table 12.8 lists the key properties, Table 12.9 the key methods, and Table 12.10 the key<br />

events of TTable.<br />

441<br />

12

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

Saved successfully!

Ooh no, something went wrong!