Accessors for class IliTransactionManager

Properties

Methods

Description

The IliTransactionManager class manages so-called local transactions where one or more IliTable objects can defer the propagation of changes they undergo until a later function call occurs. The transaction manager is responsible for recording all these changes as they happen to be able to do one of the following:
The following code assigns the same transaction manager to two given IliTable objects and then starts the transaction manager:
     var tbl_EMP = IliRepository.EMP_DS.table;
     var tbl_DEPT = IliRepository.DEPT_DS.table;

     tbl_EMP.transactionManagerName = 'TM_1';
     tbl_DEPT.transactionManagerName = 'TM_1';

     var tm = tbl_EMP.transactionManager;
     tm.start();

Note that a transaction manager named TM_1 is implicitly created when the tbl_EMP transactionManagerName is assigned. This same transaction manager is then assigned to tbl_DEPT.
A transaction manager is implicitly deleted when it is no longer referenced by any IliTable object nor by any Rogue Wave Views Script variable.

TypeNameDescriptionNotes
InteventCountContains the number of events recorded in the transaction manager. Each event corresponds to one of the following IliTable operations:
  • insertRow

  • updateRow

  • deleteRow

  • moveRow

  • exchangeRows

read-only
Booleanaccept()Accepts all work done since the most recent call to accept, cancel, or start. This typically involves having all two-tier tables propagate updates to their remote storage manager. If successful, the event count is reset to 0 and true is returned. Otherwise, the event count remains unchanged and false is returned. Note that if a two-tier table (such as an IliSQLTable) is involved in one or more of the events, a rollback should be issued by the user to its SQL session or else the state of the database transaction may become inconsistent with the state of the IliSQLTable object.
VoidaddErrorSink(Object sink)Adds an error sink to the transaction manager. When an error occurs during accept or cancel processing, it will be forwarded to this error sink. The sink parameter can be one of the following:
  • An IliErrorList object

         var errList = new IliErrorList();
         tm.addErrorSink(errList);
    

  • An IliObserver object whose func property contains a Rogue Wave Views Script function having the following signature: fct(IliErrorMessage msg)

         function OnError(msg) {
         writeln(msg.prettyMessage);
         }
         tm.addErrorSink(new IliObserver(OnError));
    
Booleancancel()Cancels all work done since the most recent call to accept, cancel, or start. This typically involves reverting the IliTable objects to the state they had at that point in time. If successful, the event count is reset to 0 and true is returned. Otherwise, the event count remains unchanged and false is returned.
IliTablegetEventTable(Int idx)Returns the IliTable object from which the event at position idx originates or NULL if idx is < 0 or >= EventCount().
IliTableEventTypegetEventType(Int idx)Returns the type of the event at position idx or UndefinedEvent if idx is < 0 or >= EventCount(). The type can be one of the following:
  • UndefinedEvent

  • InsertRowEvent

  • UpdateRowEvent

  • DeleteRowEvent

  • MoveRowEvent

  • ExchangeRowsEvent

BooleanisStarted()Returns true if the transaction manager has been started.
VoidremoveErrorSink(Object sink)Removes an error sink.
Voidstart()Starts the transaction manager.
Voidstop()Stops the transaction manager.