ObjectExtender User's Guide and Reference


Transactions in more depth

The example thus far works in a scenario with only one transaction. This is the top-level transaction that is created initially when the view opens and regenerated from the shared transaction each time it is committed. It is possible, however, to have more than one transaction in existence at the same time. At any one point in time only one transaction can be the current transaction. Whenever a transaction is created it becomes the current one and whenever a transaction is committed or rolled-back, the parent of the committed transaction will become the current transaction after the commit. To illustrate this consider the following code:

     Transaction reset
 
 

This will reset all transactions back to an initial state. Only the shared transaction will exist.

 
 
     Transaction current
 
 
 

The above therefore will return the shared transaction. This can also be done with the explicit message:

 
 
     Transaction shared

When a new top-level transaction is started, it is the current transaction. For example,

 
 
     Transaction begin.
     Transaction current.
 
 
 

The current transaction is now the top-level transaction.

 
 
     Transaction current rollback.
     Transaction current.
 
 
 

The above code would roll back the top-level transaction, and the current transaction would now be the shared transaction (the parent of the top-level transaction).


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]