VisualIB
1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
|
VIB::Transaction wraps the VisualIB VIBTransaction structure with a C++11 object which emulates the semantics of Borland TIBTransaction. More...
#include <classVIBTransaction.h>
Classes | |
class | DatabasesClass |
Property implementation class for the Databases property. More... | |
class | ParamClass |
Property implementation class for parameters. More... | |
Public Member Functions | |
Transaction (VIBTransaction *pvtr=NULL) | |
Construct a new VIB::Transaction. | |
virtual | ~Transaction () |
Destroy the VIB::Transaction object and the VIBTransaction it wraps. | |
int | Call (int ErrCode, bool RaiseError) |
Returns an error message based on the error code. | |
void | Commit () |
Permanently stores updates, insertions, and deletions of data associated with the current transaction, and ends the current transaction. | |
void | CommitRetaining () |
Commits the active transaction and retains the transaction context. | |
void | Rollback () |
Cancels all updates, insertions, and deletions for the current transaction and ends the transaction. | |
void | RollbackRetaining () |
Cancels all updates, insertions, and deletions for the current transaction and retains the transaction context. | |
void | StartTransaction () |
Begins a new transaction against the database server. | |
void | CheckInTransaction () |
Checks whether the transaction is active and whether there are any databases in the transaction's database list. | |
void | CheckNotInTransaction () |
Checks that the transaction is not active and that there are no databases in the transaction's database list. | |
void | CheckAutoStop () |
Undocumented method. | |
int | AddDatabase (Database *db) |
Associates a database to the transaction. | |
int | FindDatabase (Database *db) |
Finds the index of the associated database. | |
VIBDatabase * | FindDefaultDatabase () |
Undocumented method. | |
void | RemoveDatabase (int Idx) |
Disassociates a database from the transaction. | |
void | RemoveDatabases () |
Disassociates all databases from the transaction. | |
void | CheckDatabasesInList () |
Checks if there are any databases in the list. | |
VIBTransaction * | getVIBTransaction () const |
Obtain the underlying VisualIB VIBTransaction C structure instance. | |
Public Attributes | |
Property< bool > | Active |
Specifies whether or not a transaction is active. | |
Property< VIBAutoStopAction > | AutoStopAction |
Undocumented property. | |
Property< int > | DatabaseCount |
Indicates the number of databases that are part of the transaction. | |
Property< VIBTransactionAction > | DefaultAction |
Specifies what action a transaction should take upon timing out. | |
Property< VIBDatabase * > | DefaultDatabase |
Sets or returns the default database for the transaction. | |
Property< void * > | Handle |
Returns the transaction handle. | |
Property< bool > | HandleIsShared |
Indicates whether or not the handle is shared. | |
Property< int > | IdleTimer |
Specifies how long the transaction should wait before automatically committing or rolling back, based on the DefaultAction property. | |
Property< bool > | InTransaction |
Indicates whether a database transaction is in progress or not. | |
Property< ParamClass * > | Params |
Returns the transaction parameter buffer. | |
Property< int > | SQLObjectCount |
Returns the number of currently active datasets, SQL objects, and blobs associated with the database. | |
Property< char * > | TPB |
Provides a read-only view of the transaction parameter buffer. | |
Property< short > | TPBLength |
Use to retrieve the length of the transaction parameter buffer. | |
ArrayProperty< DatabasesClass *, VIBDatabase * > | Databases |
Use to obtain the database at a given integer index. | |
Protected Attributes | |
VIBTransaction * | vtr |
Pointer to the wrapped VIBTransaction instance. | |
DatabasesClass | dbObject |
Instance of Databases property wrapper. | |
ParamClass | paramObject |
Instance of Params property wrapper. | |
Friends | |
class | ParamClass |
VIB::Transaction wraps the VisualIB VIBTransaction structure with a C++11 object which emulates the semantics of Borland TIBTransaction.
VIB::Transaction::Transaction | ( | VIBTransaction * | pvtr = NULL | ) |
Construct a new VIB::Transaction.
[in] | pvtr | Optional pointer to an existing VIBTransaction instance of which this object should take ownership. |
int VIB::Transaction::AddDatabase | ( | Database * | db | ) |
Associates a database to the transaction.
[in] | db | Pointer to a VIB::Database instance. |
int VIB::Transaction::Call | ( | int | ErrCode, |
bool | RaiseError | ||
) |
Returns an error message based on the error code.
Internal method used to make calls to the InterBase API, giving the option of throwing an exception or returning an error.
[in] | ErrCode | InterBase API error code? |
[in] | RaiseError | If true, an exception will be thrown. |
void VIB::Transaction::CheckAutoStop | ( | ) |
Undocumented method.
void VIB::Transaction::CheckDatabasesInList | ( | ) |
Checks if there are any databases in the list.
IF there are none, an exception will be thrown.
void VIB::Transaction::CheckInTransaction | ( | ) |
Checks whether the transaction is active and whether there are any databases in the transaction's database list.
If either condition is false, an exception is thrown.
void VIB::Transaction::CheckNotInTransaction | ( | ) |
Checks that the transaction is not active and that there are no databases in the transaction's database list.
If either condition is false, an exception is thrown.
void VIB::Transaction::Commit | ( | ) |
Permanently stores updates, insertions, and deletions of data associated with the current transaction, and ends the current transaction.
If there is no current transaction, an exception will be thrown.
void VIB::Transaction::CommitRetaining | ( | ) |
Commits the active transaction and retains the transaction context.
int VIB::Transaction::FindDatabase | ( | Database * | db | ) |
Finds the index of the associated database.
[in] | db | Pointer to a VIB::Database instance. |
VIBDatabase * VIB::Transaction::FindDefaultDatabase | ( | ) |
Undocumented method.
|
inline |
Obtain the underlying VisualIB VIBTransaction C structure instance.
void VIB::Transaction::RemoveDatabase | ( | int | Idx | ) |
Disassociates a database from the transaction.
[in] | Idx | Index of the database, as returned by FindDatabase. |
void VIB::Transaction::RemoveDatabases | ( | ) |
Disassociates all databases from the transaction.
void VIB::Transaction::Rollback | ( | ) |
Cancels all updates, insertions, and deletions for the current transaction and ends the transaction.
If there is no current transaction, an exception will be thrown.
void VIB::Transaction::RollbackRetaining | ( | ) |
Cancels all updates, insertions, and deletions for the current transaction and retains the transaction context.
void VIB::Transaction::StartTransaction | ( | ) |
Begins a new transaction against the database server.
Before calling, an application should check the status of the InTransaction property. Updates, insertions, and deletions that take place after a call to StartTransaction are held by the server until an application calls Commit to save the changes or Rollback to cancel them.
Property<bool> VIB::Transaction::Active |
Specifies whether or not a transaction is active.
Property<VIBAutoStopAction> VIB::Transaction::AutoStopAction |
Undocumented property.
Property<int> VIB::Transaction::DatabaseCount |
Indicates the number of databases that are part of the transaction.
ArrayProperty<DatabasesClass *, VIBDatabase *> VIB::Transaction::Databases |
Use to obtain the database at a given integer index.
Property<VIBTransactionAction> VIB::Transaction::DefaultAction |
Specifies what action a transaction should take upon timing out.
Property<VIBDatabase *> VIB::Transaction::DefaultDatabase |
Sets or returns the default database for the transaction.
Property<void *> VIB::Transaction::Handle |
Returns the transaction handle.
Property<bool> VIB::Transaction::HandleIsShared |
Indicates whether or not the handle is shared.
Property<int> VIB::Transaction::IdleTimer |
Specifies how long the transaction should wait before automatically committing or rolling back, based on the DefaultAction property.
Property<bool> VIB::Transaction::InTransaction |
Indicates whether a database transaction is in progress or not.
Property<ParamClass *> VIB::Transaction::Params |
Returns the transaction parameter buffer.
Use to examine and set parameters in the buffer. Refer to the InterBase API Guide for the names of the parameters to provide.
Property<int> VIB::Transaction::SQLObjectCount |
Returns the number of currently active datasets, SQL objects, and blobs associated with the database.
Property<char *> VIB::Transaction::TPB |
Provides a read-only view of the transaction parameter buffer.
Property<short> VIB::Transaction::TPBLength |
Use to retrieve the length of the transaction parameter buffer.