Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
None.
Purpose:
This concrete class controls the committing or rolling back of a database transaction. Multiple transaction handles can exist for a single transaction.
The transaction itself requires unanimous Commit vote from all of its handles before committing. Any rollback or uncommitted destruction of a transaction handle causes the actual transaction to rollback. All SQLDAS/Base editing commands are committed as individual units of work. Instances of TSQLTransactionHandle can be used freely with SQLDAS/Base editing commands to extend the unit of work. The transaction is committed when the outermost transaction object is committed.
Instantiation:
Always allocate on the stack.
Deriving Classes:
None. Providers will probably not need to derive from this class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TSQLTransactionHandle ()
- TSQLTransactionHandle (const TSQLTransactionHandle &)
Interface Category:
API.
Purpose:
- Default constructor. SQL transaction handles are created by a connection when the client application invokes the CreateSQLTransaction member function.
Clients can use the default constructor to create an empty transaction handle. The only thing that a client should do with such a handle to assign a valid SQL transaction handle to it.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and any other function that needs to construct an uninitialized object.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TSQLTransactionHandle ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The semantics of destruction are special in that the destruction of an uncommitted transaction handle results in a rollback of the associated transaction. This design allows transactions to be rolled back automatically when a transaction handle is destroyed by a thrown exception.
virtual void Commit ()
Interface Category:
API.
Purpose:
Registers this transaction handle's vote for committing the associated transaction.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through. Any attempt to recommit or rollback a committed transaction handle results in an exception.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void Rollback ()
Interface Category:
API.
Purpose:
Immediately rolls back the associated transaction.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through. Any attempt to recommit or rollback a rolled back transaction handle results in an exception.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ETransactionState GetState () const
Interface Category:
API.
Purpose:
Returns the current state of the transaction associated with the handle.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The current state of the transaction.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TSQLTransactionHandle & operator =(const TSQLTransactionHandle &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual void SetConnection (TSQLConnection *)
Interface Category:
API.
Purpose:
Binds an uninitialized transaction handle into a connection.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.