Main Table of Contents


Table of Contents

class PtTransProps
PtTransProps: class summary
PtTransProps::PtTransProps()
PtTransProps::PtTransProps()
PtTransProps::GetCheckPoint()
PtTransProps::GetRefreshOnAbort()
PtTransProps::GetUseShadowIndex()

class PtTransProps


Intro
PtTransProps: class summary
PtTransProps::PtTransProps()
PtTransProps::PtTransProps()
PtTransProps::GetCheckPoint()
PtTransProps::GetRefreshOnAbort()
PtTransProps::GetUseShadowIndex()

The PtTransProps class is used with the BeginTransaction method of PtBase. By using this properties class you can change the behavior of the transaction.

The first property that can be controlled is whether or not the transaction uses shadow indexes. These shadow indexes are built in memory and record the changes to the index tree that have not yet been committed to the database. The shadow indexes are used when you perform a query or other related operation while within the transaction. This shadow index functionality can be very useful but can also cause considerable overhead both in memory resources and in overall performance.

This is particularly true when using POET in a client/server environment since a network access must be made to keep the index in memory up to date every time a change is made to an object. If you do not need to maintain an up-to-the-minute index for the objects within a transaction you should consider disabling shadow indexes.

The second area concerns the behavior exhibited by the transaction model when you call Abort. In the default behavior, the objects that were modified are not automatically returned to the state they had when the transaction was begun. You would have to call Refresh for each modified object if you wanted to return the object to its pre-transaction value. However, with the exetnded transaction funtionality provided by the PtTransProps class, refresh on abort can be made automatic if desired. The PtTransProps class can also be used to specify that an intermediate Commit should be performed automatically for a specified number of objects that are modified while within the transaction. This means that the transaction is no longer atomic. That is, the transaction no longer acts like a single all-or-nothing transaction but is sub-divided, so to speak, into smaller transactions of n objects each. The intermediate Commits are real and cannot be rolled back. However, for long transactions that involve many objects, this can help to avoid running out of memory. The BeginTransaction method can take an argument of type pointer to PtTransProps. Normally this argument defaults to NULL and the transaction will exhibit the default transaction behavior. That is, atomic transactions with shadow indexes and without automatic refresh. In order to direct the transaction to not use shadow indexes, to use automatic refresh on abort, or to specify intermediate commits, you will have to create an object of type PtTransProps and pass the address of this object to the BeginTransaction method.


PtTransProps: class summary


Intro

Files to include Class declaration Base class
poet.hxx ptbase.hxx none

Member functions:

constructor PtTransProps();
GetCheckPoint inline PtWord GetCheckPoint() const;
GetRefreshOnAbort inline PtBool GetRefreshOnAbort() const;
GetUseShadowIndex inline PtBool GetUseShadowIndex() const;

PtTransProps::PtTransProps()


Intro

Declaration:

PtTransProps::PtTransProps()

Description:

Default constructor.


PtTransProps::PtTransProps()


Intro

Declaration:

PtTransProps::PtTransProps(PtBool bUseShadowIndex, PtBool bRefreshOnAbort, PtWord nCheckPoint = 0)

Description:

Constructor .

Parameters:

The first parameter bUseShadowIndex determines whether shadow indexes are used or not. This is a boolean flag and can be set to either PtTRUE or PtFALSE. To disable shadow indexes, you would need to create a PtTransProps object and use PtFALSE for this parameter. Then you would pass the PtTransProps object to the BeginTransaction method. The second parameter bRefreshOnAbort determines whether modifyed objects are automatically refreshed in RAM if you Abort the transaction. This is also a boolean flag and can be set to PtTRUE or PtFALSE. A PtFALSE argument here will cause the transaction that uses the properties object to behave in the normal fashion. If you set this parameter to PtTRUE, then if you abort the transaction that uses the properties object, the modified objects will be automatically returned to the state they were in when the you began the transaction.

The last parameter, nCheckPoint can be used to specify that an intermediate Commit should be performed automatically for every nCheckPoint objects that are modified while within the transaction. The default is 0 which means that no intermediate commits should be performed. The intermediate Commits are real and cannot be rolled back.

These parameters may be used in any combination.


PtTransProps::GetCheckPoint()


Intro

Declaration:

inline PtWord PtTransProps::GetCheckPoint() const

Description:

Returns the checkpoint value for this property object. The checkpoint value is the number of modified objects that will trigger an automatic commit in the transaction that uses this property object.


PtTransProps::GetRefreshOnAbort()


Intro

Declaration:

inline PtBool PtTransProps::GetRefreshOnAbort() const

Description:

Returns PtTRUE if refresh on abort is set for this propery object. Returns PtFALSE if it is not.


PtTransProps::GetUseShadowIndex()


Intro

Declaration:

inline PtBool PtTransProps::GetUseShadowIndex() const

Description:

Returns PtTRUE if use shadow index is set for this propery object. Returns PtFALSE if it is not.

Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.