company logo

ObjectSpace :: beginTransaction - Start transaction

The function starts an internal or external transaction. Transactions can be stopped by calling commitTransaction() (accept changes) or rollBack() (discard changes).

Return value:  Transaction level ( int32  )

The transaction level identifies a transaction within a hierarchy of nested transactions. The out most transaction starts with number 1.

Implementation overview

Implementation details

  1. Create transaction
    int32 ObjectSpace  :: beginTransaction (  )

    The function can be called for creating (starting) an internal transaction. All modifications made are stored in an internal transaction buffer.

  2. to list
  3. Create dynamic transaction buffer
    int32 ObjectSpace  :: beginTransaction ( int32 iBufferSize )

    In order to create a dynamic transaction buffer, a maximum transaction buffer size has to be passed in iBufferSize. A transaction buffer always creates an internal transaction, which will be committed when the maximum buffer size has exceeded.

    • iBufferSize - Number of instance buffers

      This is the maximum number of instance buffers.

  4. to list
  5. Externally stored transaction
    int32 ObjectSpace  :: beginTransaction ( bool bExternalTA )

    In order to start an external transaction, true has to be passed in bExternalTA. Passing false causes starting an internal transaction.

    Data updated within the transaction will be stored in an external transaction database, which allows running very long transactions. External transaction databases are created referring to the location (folder) as being defined in the TABASE option. Each transaction level for an external transaction creates a new transaction database with the name tabasexx.eta, where xx is the transaction number.

    Notes:

    Using external transaction, one has to make sure, the TABASE is set to different location for each application. Otherwise, parallel transactions referring to the same location will fail.

    • bExternalTA - External transaction

      In order to start the transaction as external transaction, true must be passed. For an external transaction all modification are stored to an external transaction base. When passing false the transaction is started as internal transaction, i.e. the modifications are stored in memory.

  6. to list