Overview of 4C External Database Files

Overview of 4C External Database Files

There were two main design issues involved in allowing 4C to use external database files, whether Sybase, Oracle, Postgres or some other database.


Mapping 4C File Definitions




Transactions

4C has two different ways of handling transactions. The first is when the application has not specifically called sys.begin(). In this case 4C commits the transaction every time the number of rcds locked goes to zero. The number of rcd locks is a 4C notion completely separate from the DBMS idea of rcd locks. In this context, it is simply a count of the number of file accesses that specify F_ACC,F_MODIFY,or F_DELETE. 4C begins a transaction after every commit. The isolation level of transactions started this way will be the same as the default isolation level specified in the external type definition.

You are free to change this default way of handling transactions by modifying the application and explicitly calling sys.begin(), sys.commit(), and sys.rollback(). When running transactions this way you can specify the isolation level of individual transactions or use the default specified in the external type definition.


Database Connections




Transparent SQL

The main interaction of 4C with the external database is in the mapping of the sys.read_file(), sys.upd_file(0, and sys.run_driver() statements. 4C maps all file accesses to SQL requests without the application needing any changes.

When the external database allows it, 4C prepares the sql statements and submits them to the DBMS in prepared form. 4C keeps the prepared statements as long as possible. Different 4C programs using the same database connection will use the same prepared statements. Different users will not share the same prepared statements.

Back to Top