rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliTransactionManager Class Reference

Table class. More...

#include <ilviews/dataccess/transmgr.h>

Inheritance diagram for IliTransactionManager:
IliRefCounted

List of all members.

Public Member Functions

 IliTransactionManager ()
 Initializes an anonymous transaction manager.
IlBoolean accept ()
 Accepts all recorded events.
void addErrorSink (IliErrorSink *sink)
 Adds an error sink to the transaction manager.
IlBoolean cancel ()
 Cancels all recorded events.
IlInt getEventCount () const
 Returns the number of events recorded in the transaction manager.
IliTablegetEventTable (IlInt idx) const
 Returns an event table.
EventType getEventType (IlInt idx) const
 Returns an event type.
const char * getName () const
 Returns the transaction manager name.
IlBoolean hasAName () const
 Returns IlTrue if the transaction manager has a name.
IlBoolean isRecording () const
 Returns IlTrue if the transaction manager has been started and if events should be recorded.
IlBoolean isStarted () const
 Returns IlTrue if the transaction manager has been started.
void recordDeleteRow (IliTable *table, IlInt row)
 This member function should be called just before the row at position row in the table is deleted.
void recordExchangeRows (IliTable *tbl, IlInt row1, IlInt row2)
 This member function should be called when a row in the table has been exchanged with another.
void recordInsertRow (IliTable *tbl, IlInt row, const IliTableBuffer *buff)
 This member function should be called when a row is inserted in the table at position row.
void recordMoveRow (IliTable *tbl, IlInt from, IlInt to)
 This member function should be called when the row at a position in the table is moved to another position.
void recordUpdateRow (IliTable *tbl, IlInt row, const IliTableBuffer *buff)
 This member function should be called when the row at position row in the table is updated.
void removeErrorSink (IliErrorSink *sink)
 Removes an error sink from this transaction manager.
void start ()
 Starts the transaction manager.
void stop ()
 Stops the transaction manager.

Static Public Member Functions

static IliTransactionManagerAt (IlInt idx)
 Returns a transaction manager.
static IlInt Count ()
 Returns the number of named transaction managers that exist.
static IliTransactionManagerGet (const char *name, IlBoolean createIt=IlFalse)
 Returns a transaction manager.

Detailed Description

Table class.

Library: dataccess

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 so that it can do one of the following:

See also:
Classes: IliTable

Member Function Documentation

IlBoolean IliTransactionManager::accept (  ) 

Accepts all recorded events.

This typically involves having all two-tier tables propagate updates to their remote storage manager. If successful, the event count is reset to 0. Otherwise, the event count remains unchanged. Note that if a two-tier table (such as an IliSQLTable object) 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. Events are accepted in order of occurrence (from the oldest to the most recent). In the case where one event fails, no attempt is made to accept the subsequent events in the chain and IlFalse is immediately returned.

Returns:
IlTrue if successful.
void IliTransactionManager::addErrorSink ( IliErrorSink sink  ) 

Adds an error sink to the transaction manager.

Any errors that occur during calls to the cancel and accept member functions will be forwarded to this error sink.

Parameters:
sink The added error sink.
static IliTransactionManager* IliTransactionManager::At ( IlInt  idx  )  [static]

Returns a transaction manager.

Parameters:
idx The transaction manager position.
Returns:
The named transaction manager positioned at idx or returns NULL if the position is out of bound.
IlBoolean IliTransactionManager::cancel (  ) 

Cancels all recorded events.

This typically involves reverting the IliTable objects to the state they had before the transaction started. If successful, the event count is reset to 0. Otherwise, the event count remains unchanged.

Returns:
IlTrue if successful.
static IlInt IliTransactionManager::Count (  )  [static]

Returns the number of named transaction managers that exist.

Returns:
The count.
static IliTransactionManager* IliTransactionManager::Get ( const char *  name,
IlBoolean  createIt = IlFalse 
) [static]

Returns a transaction manager.

Parameters:
name The transaction manager name.
createIt The creation flag. If it is true, the transaction manager is created when it does not exist.
Returns:
The transaction manager. If no such transaction manager exists and if the createIt parameter is true, a new transaction manager named name is created and returned. Otherwise, NULL is returned.
IlInt IliTransactionManager::getEventCount (  )  const

Returns the number of events recorded in the transaction manager.

Returns:
The number of events recorded in the transaction manager. Each event corresponds to one of the following IliTable operations:
  • insertRow
  • updateRow
  • deleteRow
  • moveRow
  • exchangeRows
IliTable* IliTransactionManager::getEventTable ( IlInt  idx  )  const

Returns an event table.

Parameters:
idx,: The event position.
Returns:
The IliTable object from which the event at position idx originates or NULL if the position is out of bound.
EventType IliTransactionManager::getEventType ( IlInt  idx  )  const

Returns an event type.

Parameters:
idx,: The event position.
Returns:
The type of the event at position idx or UndefinedEvent if idx is out of bound. The type can be one of the following:
  • UndefinedEvent
  • InsertRowEvent
  • UpdateRowEvent
  • DeleteRowEvent
  • MoveRowEvent
  • ExchangeRowsEvent
const char* IliTransactionManager::getName (  )  const

Returns the transaction manager name.

Returns:
The name of the transaction manager or the empty string if it has no name.
IlBoolean IliTransactionManager::hasAName (  )  const

Returns IlTrue if the transaction manager has a name.

Returns:
IlTrue if the transaction manager has a name.
IlBoolean IliTransactionManager::isRecording (  )  const

Returns IlTrue if the transaction manager has been started and if events should be recorded.

Returns:
IlTrue if the transaction manager has been started and if events should be recorded. Returns IlFalse if the transaction manager has not been started or if it is currently performing one of the accept or cancel member functions. In such cases, no events should be recorded.
IlBoolean IliTransactionManager::isStarted (  )  const

Returns IlTrue if the transaction manager has been started.

Returns:
IlTrue if the transaction manager has been started.
void IliTransactionManager::recordDeleteRow ( IliTable table,
IlInt  row 
)

This member function should be called just before the row at position row in the table is deleted.

Parameters:
tbl The table.
row The row position.
void IliTransactionManager::recordExchangeRows ( IliTable tbl,
IlInt  row1,
IlInt  row2 
)

This member function should be called when a row in the table has been exchanged with another.

Parameters:
tbl The table.
row1 The first row position.
row2 The second row position.
void IliTransactionManager::recordInsertRow ( IliTable tbl,
IlInt  row,
const IliTableBuffer buff 
)

This member function should be called when a row is inserted in the table at position row.

The values of the new row are given in the table buffer buff.

Parameters:
tbl The table.
row The row position.
buff The row data.
void IliTransactionManager::recordMoveRow ( IliTable tbl,
IlInt  from,
IlInt  to 
)

This member function should be called when the row at a position in the table is moved to another position.

Parameters:
tbl The table.
from The from position.
to The to position.
void IliTransactionManager::recordUpdateRow ( IliTable tbl,
IlInt  row,
const IliTableBuffer buff 
)

This member function should be called when the row at position row in the table is updated.

The modified values of the row are given in the table buffer buff.

Parameters:
tbl The table.
row The row position.
buff The row data.
void IliTransactionManager::removeErrorSink ( IliErrorSink sink  ) 

Removes an error sink from this transaction manager.

Parameters:
sink The removed error sink.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.